From 5d9e65058cb2f54434bd48c3442c1d43f766b553 Mon Sep 17 00:00:00 2001 From: Bernhard Roider Date: Sun, 13 May 2007 19:53:06 +0000 Subject: [PATCH] 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 --- src/Text2.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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_; -- 2.39.5