From: Bernhard Roider Date: Sun, 13 May 2007 19:53:06 +0000 (+0000) Subject: fix cursor movement (up/down) problem at the end of lines in insets and table cells. X-Git-Tag: 1.6.10~9796 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5d9e65058cb2f54434bd48c3442c1d43f766b553;p=lyx.git fix cursor movement (up/down) problem at the end of lines in insets and table cells. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18293 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Text2.cpp b/src/Text2.cpp index c4f9af1d01..9992d257c2 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -991,10 +991,10 @@ bool Text::cursorUp(Cursor & cur) else row = pm.pos2row(cur.pos()); - // remember current position only if we are not at the end of a row. - if (cur.pos() != pm.rows()[row].endpos()) - cur.setTargetX(); - int const x = cur.targetX(); + int x = cur.targetX(); + cur.setTargetX(); + if (cur.pos() != pm.rows()[row].endpos() || x < cur.targetX()) + x = cur.targetX(); if (!cur.selection()) { int const y = bv_funcs::getPos(cur.bv(), cur, cur.boundary()).y_; @@ -1050,10 +1050,10 @@ bool Text::cursorDown(Cursor & cur) else row = pm.pos2row(cur.pos()); - // remember current position only if we are not at the end of a row. - if (cur.pos() != pm.rows()[row].endpos()) - cur.setTargetX(); - int const x = cur.targetX(); + int x = cur.targetX(); + cur.setTargetX(); + if (cur.pos() != pm.rows()[row].endpos() || x < cur.targetX()) + x = cur.targetX(); if (!cur.selection()) { int const y = bv_funcs::getPos(cur.bv(), cur, cur.boundary()).y_;