From 410847bd70ade1501a53cf6ff3c1a3ac707776c9 Mon Sep 17 00:00:00 2001 From: Alfredo Braunstein Date: Tue, 28 Oct 2003 11:03:36 +0000 Subject: [PATCH] fix the end key git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7994 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/text2.C | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index f9d8cb9699..3bc0e9f2b7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-10-28 Alfredo Braunstein + + * text2.C (cursorEnd): simple fix to the "end key goes to one + before the end on last row" bug + 2003-10-27 Alfredo Braunstein * text.C (backspace): fix the "zombie characters" diff --git a/src/text2.C b/src/text2.C index 2daf79d25f..e89b13e75f 100644 --- a/src/text2.C +++ b/src/text2.C @@ -570,7 +570,10 @@ void LyXText::cursorHome() void LyXText::cursorEnd() { ParagraphList::iterator cpit = cursorPar(); - setCursor(cpit, cpit->getRow(cursor.pos())->endpos() - 1); + pos_type end = cpit->getRow(cursor.pos())->endpos(); + /* if not on the last row of the par, put the cursor before + the final space */ + setCursor(cpit, end == cpit->size() ? end : end - 1); } -- 2.39.2