From: José Matox Date: Thu, 13 Jun 2002 18:07:40 +0000 (+0000) Subject: keep x coordinate target when moving up/down X-Git-Tag: 1.6.10~19085 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8953a40f95d8a357e6ae33a058bb43be06748aea;p=features.git keep x coordinate target when moving up/down git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4395 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 99d009f56a..57787f6d59 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -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(); diff --git a/src/mathed/math_cursor.h b/src/mathed/math_cursor.h index ed627c786c..1d8e95950b 100644 --- a/src/mathed/math_cursor.h +++ b/src/mathed/math_cursor.h @@ -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;