fix the end key

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7994 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Alfredo Braunstein 2003-10-28 11:03:36 +00:00
parent 09548338ce
commit 410847bd70
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2003-10-28 Alfredo Braunstein <abraunst@libero.it>
* text2.C (cursorEnd): simple fix to the "end key goes to one
before the end on last row" bug
2003-10-27 Alfredo Braunstein <abraunst@libero.it> 2003-10-27 Alfredo Braunstein <abraunst@libero.it>
* text.C (backspace): fix the "zombie characters" * text.C (backspace): fix the "zombie characters"

View File

@ -570,7 +570,10 @@ void LyXText::cursorHome()
void LyXText::cursorEnd() void LyXText::cursorEnd()
{ {
ParagraphList::iterator cpit = cursorPar(); 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);
} }