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
This commit is contained in:
José Matox 2002-06-13 18:07:40 +00:00
parent 737a9ddcf4
commit 8953a40f95
2 changed files with 12 additions and 1 deletions

View 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();

View 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;