]> git.lyx.org Git - features.git/commitdiff
leave formula when pressing end at the end of a formula (and similarly
authorAndré Pönitz <poenitz@gmx.net>
Thu, 18 Jul 2002 10:07:20 +0000 (10:07 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 18 Jul 2002 10:07:20 +0000 (10:07 +0000)
'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
src/mathed/math_cursor.C
src/mathed/math_cursor.h

index f1f6c90ff7283c36ba6b9e3c234f3f9ca5d8e492..26beee4ca1089ad198263f8adc3b321bdeb7210d 100644 (file)
@@ -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;
 
index ab4a44fe5c3bc7cb55c62674b05b63cbbc2de2ae..ad8ae53d173786d258c5362b72f2d3fbcad0c0fa 100644 (file)
@@ -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;
 }
 
 
index d00b294273e92c3c11904a20aeca32c80071a632..df32032dc9da365d00ad0c311541cee10a959117 100644 (file)
@@ -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