mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
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:
parent
edb3ec204d
commit
c96136c040
@ -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>
|
2003-09-02 Lars Gullik Bjønnes <larsbj@gullik.net>
|
||||||
|
|
||||||
* buffer.C (readFile): add a space
|
* buffer.C (readFile): add a space
|
||||||
|
19
src/text2.C
19
src/text2.C
@ -675,21 +675,12 @@ void LyXText::cursorEnd()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
RowList::iterator rit = cursorRow();
|
RowList::iterator rit = cursorRow();
|
||||||
RowList::iterator next_rit = boost::next(rit);
|
|
||||||
RowList::iterator end = boost::next(rit);
|
|
||||||
ParagraphList::iterator pit = cursor.par();
|
ParagraphList::iterator pit = cursor.par();
|
||||||
pos_type last_pos = lastPos(*pit, rit);
|
pos_type pos = lastPos(*pit, rit);
|
||||||
|
/* cursor should be before a hard newline only */
|
||||||
if (next_rit == end) {
|
if (!pit->isNewline(pos))
|
||||||
++last_pos;
|
++pos;
|
||||||
} else {
|
setCursor(pit, pos);
|
||||||
if (pit->empty() ||
|
|
||||||
(pit->getChar(last_pos) != ' ' && !pit->isNewline(last_pos))) {
|
|
||||||
++last_pos;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setCursor(pit, last_pos);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user