Alfredo getchar() fix

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6751 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2003-04-09 22:28:51 +00:00
parent 10f2975d95
commit 379097c72c
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2003-04-09 Alfredo Braunstein <abraunst@libero.it>
* text2.C (cursorRight): a getChar assert fixed
2003-04-09 Lars Gullik Bjønnes <larsbj@gullik.net> 2003-04-09 Lars Gullik Bjønnes <larsbj@gullik.net>
* text2.C (getFont): change to take a ParagraphList::iterator * text2.C (getFont): change to take a ParagraphList::iterator

View File

@ -2055,10 +2055,13 @@ void LyXText::cursorLeft(bool internal)
void LyXText::cursorRight(bool internal) void LyXText::cursorRight(bool internal)
{ {
if (!internal && cursor.boundary() && bool const at_end = (cursor.pos() == cursor.par()->size());
!cursor.par()->isNewline(cursor.pos())) bool const at_newline = !at_end &&
cursor.par()->isNewline(cursor.pos());
if (!internal && cursor.boundary() && !at_newline)
setCursor(cursor.par(), cursor.pos(), true, false); setCursor(cursor.par(), cursor.pos(), true, false);
else if (cursor.pos() < cursor.par()->size()) { else if (!at_end) {
setCursor(cursor.par(), cursor.pos() + 1, true, false); setCursor(cursor.par(), cursor.pos() + 1, true, false);
if (!internal && if (!internal &&
isBoundary(bv()->buffer(), &*cursor.par(), cursor.pos())) isBoundary(bv()->buffer(), &*cursor.par(), cursor.pos()))