]> git.lyx.org Git - features.git/commitdiff
keep x coordinate target when moving up/down
authorJosé Matox <jamatos@lyx.org>
Thu, 13 Jun 2002 18:07:40 +0000 (18:07 +0000)
committerJosé Matox <jamatos@lyx.org>
Thu, 13 Jun 2002 18:07:40 +0000 (18:07 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4395 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_cursor.C
src/mathed/math_cursor.h

index 99d009f56a2d457d6f55bf3d4b5ed58dfbbcc091..57787f6d590b82e13ee494935d5c0396771cc987 100644 (file)
@@ -304,6 +304,7 @@ bool MathCursor::left(bool sel)
 {
        dump("Left 1");
        autocorrect_ = false;
+       targetx_ = false;
        if (inMacroMode()) {
                macroModeClose();
                return true;
@@ -323,6 +324,7 @@ bool MathCursor::right(bool sel)
 {
        dump("Right 1");
        autocorrect_ = false;
+       targetx_ = false;
        if (inMacroMode()) {
                macroModeClose();
                return true;
@@ -1172,6 +1174,12 @@ bool MathCursor::goUpDown(bool up)
   int xo, yo;
        getPos(xo, yo);
 
+       // check if we had something else in mind, if not, this is the future goal
+       if (targetx_)
+               xo = targetx_;
+       else    
+               targetx_ = xo;
+
        // try neigbouring script insets
        // try left
        if (hasPrevAtom()) {
@@ -1415,6 +1423,7 @@ bool MathCursor::inMathMode() const
 bool MathCursor::interpret(char c)
 {
        //lyxerr << "interpret 2: '" << c << "'\n";
+       targetx_ = false;
        if (inMacroArgMode()) {
                --pos();
                plainErase();
index ed627c786c4024f50a9dcdfd02bff19623daf4be..1d8e95950b88b83ef77bf30f50b10ba09ba18827 100644 (file)
@@ -120,7 +120,7 @@ public:
        bool script(bool);
        ///
        bool interpret(string const &);
-       ///
+       /// 
        bool interpret(char);
        ///
        bool toggleLimits();
@@ -292,6 +292,8 @@ private:
        bool selection_;
        /// are we entering a macro name?
        bool macromode_;
+       /// are we targeting a certain x coordinate, if so, which one?
+       int targetx_;
 };
 
 extern MathCursor * mathcursor;