]> git.lyx.org Git - features.git/commitdiff
Make Shift-End and Shift-Pos1 work as expected
authorAndré Pönitz <poenitz@gmx.net>
Thu, 30 Aug 2001 10:17:28 +0000 (10:17 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 30 Aug 2001 10:17:28 +0000 (10:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2629 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/formulabase.C
src/mathed/math_cursor.C
src/mathed/math_cursor.h
src/mathed/math_parser.C

index e55f403642b51b867fe3a14d5eb5484f981e8b4f..5caf39373865de065313de937824156fc60d1b16 100644 (file)
@@ -412,13 +412,19 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
                updateLocal(bv, false);
                break;
 
+       case LFUN_HOMESEL:
+               sel = true;
+
        case LFUN_HOME:
-               mathcursor->home();
+               mathcursor->home(sel);
                updateLocal(bv, false);
                break;
 
+       case LFUN_ENDSEL:
+               sel = true;
+
        case LFUN_END:
-               mathcursor->end();
+               mathcursor->end(sel);
                updateLocal(bv, false);
                break;
 
@@ -492,8 +498,6 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
                mathcursor->selCopy();
                break;
 
-       case LFUN_HOMESEL:
-       case LFUN_ENDSEL:
        case LFUN_WORDRIGHTSEL:
        case LFUN_WORDLEFTSEL:
                break;
index a5086ffba6d529ae709cc5def1adfc922830a8dd..fee51f6ff33477f7b4cc335c485875b2da3516e9 100644 (file)
@@ -368,9 +368,10 @@ void MathCursor::setPos(int x, int y)
 }
 
 
-void MathCursor::home()
+void MathCursor::home(bool sel)
 {
        dump("home 1");
+       selHandle(sel);
        macroModeClose();
        lastcode_ = LM_TC_VAR;
        if (!par()->idxHome(idx(), pos())) 
@@ -379,9 +380,10 @@ void MathCursor::home()
 }
 
 
-void MathCursor::end()
+void MathCursor::end(bool sel)
 {
        dump("end 1");
+       selHandle(sel);
        macroModeClose();
        lastcode_ = LM_TC_VAR;
        if (!par()->idxEnd(idx(), pos()))
index 90519bec17aa0cd1327c11cf083eac80e7adf45b..65d83ba2f2b29a2a5946d9ffac355ede102f5a24 100644 (file)
@@ -73,9 +73,9 @@ public:
        ///
        void backspace();
        ///
-       void home();
+       void home(bool sel = false);
        ///
-       void end();
+       void end(bool sel = false);
        ///
        bool right(bool sel = false);
        ///
index 168a438bdfcb5286b3916a53d7ff108666939923..42256d2fbc534ff557cb219a8e8c00f214f87ec1 100644 (file)
@@ -439,7 +439,7 @@ void Parser::tokenize(string const & buffer)
                }
        }
 
-#if 1
+#if 0
        lyxerr << "\nTokens: ";
        for (unsigned i = 0; i < tokens_.size(); ++i)
                lyxerr << tokens_[i];