From 31d1ab96b69ae30c73dfa0ed84076863e6218de8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 18 Jul 2002 10:07:20 +0000 Subject: [PATCH] leave formula when pressing end at the end of a formula (and similarly 'home' at the beginning) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4700 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/formulabase.C | 4 ++-- src/mathed/math_cursor.C | 10 ++++++---- src/mathed/math_cursor.h | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index f1f6c90ff7..26beee4ca1 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -481,7 +481,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action, sel = true; case LFUN_HOME: - mathcursor->home(sel); + result = mathcursor->home(sel) ? DISPATCHED : FINISHED; updateLocal(bv, false); break; @@ -489,7 +489,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action, sel = true; case LFUN_END: - mathcursor->end(sel); + result = mathcursor->end(sel) ? DISPATCHED : FINISHED_RIGHT; updateLocal(bv, false); break; diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index ab4a44fe5c..ad8ae53d17 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -292,27 +292,29 @@ void MathCursor::setPos(int x, int y) -void MathCursor::home(bool sel) +bool MathCursor::home(bool sel) { dump("home 1"); autocorrect_ = false; selHandle(sel); macroModeClose(); if (!par()->idxHome(idx(), pos())) - popLeft(); + return popLeft(); dump("home 2"); + return true; } -void MathCursor::end(bool sel) +bool MathCursor::end(bool sel) { dump("end 1"); autocorrect_ = false; selHandle(sel); macroModeClose(); if (!par()->idxEnd(idx(), pos())) - popRight(); + return popRight(); dump("end 2"); + return true; } diff --git a/src/mathed/math_cursor.h b/src/mathed/math_cursor.h index d00b294273..df32032dc9 100644 --- a/src/mathed/math_cursor.h +++ b/src/mathed/math_cursor.h @@ -74,9 +74,9 @@ public: /// void backspace(); /// called for LFUN_HOME etc - void home(bool sel = false); + bool home(bool sel = false); /// called for LFUN_END etc - void end(bool sel = false); + bool end(bool sel = false); /// called for LFUN_RIGHT and LFUN_RIGHTSEL bool right(bool sel = false); /// called for LFUN_LEFT etc -- 2.39.2