+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>
* text2.C (getFont): change to take a ParagraphList::iterator
void LyXText::cursorRight(bool internal)
{
- if (!internal && cursor.boundary() &&
- !cursor.par()->isNewline(cursor.pos()))
+ bool const at_end = (cursor.pos() == cursor.par()->size());
+ bool const at_newline = !at_end &&
+ cursor.par()->isNewline(cursor.pos());
+
+ if (!internal && cursor.boundary() && !at_newline)
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);
if (!internal &&
isBoundary(bv()->buffer(), &*cursor.par(), cursor.pos()))