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); }