bug 1376 partial fix and simplification.

End will still place the cursor on the next row visually if there's another row after the
current one in the par. This is a general problem, dunno why it's doing it now.

.ix() breakage possibly


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7638 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2003-09-02 15:44:36 +00:00
parent edb3ec204d
commit c96136c040
2 changed files with 10 additions and 14 deletions

View File

@ -1,3 +1,8 @@
2003-09-02 John Levon <levon@movementarian.org>
* text2.C: simplification of cursorEnd(), including partial
fix for bug 1376
2003-09-02 Lars Gullik Bjønnes <larsbj@gullik.net>
* buffer.C (readFile): add a space

View File

@ -675,21 +675,12 @@ void LyXText::cursorEnd()
return;
RowList::iterator rit = cursorRow();
RowList::iterator next_rit = boost::next(rit);
RowList::iterator end = boost::next(rit);
ParagraphList::iterator pit = cursor.par();
pos_type last_pos = lastPos(*pit, rit);
if (next_rit == end) {
++last_pos;
} else {
if (pit->empty() ||
(pit->getChar(last_pos) != ' ' && !pit->isNewline(last_pos))) {
++last_pos;
}
}
setCursor(pit, last_pos);
pos_type pos = lastPos(*pit, rit);
/* cursor should be before a hard newline only */
if (!pit->isNewline(pos))
++pos;
setCursor(pit, pos);
}