mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Refine fix for bug #9151.
Now the cursor in LyX jumps to the right spot instead of simply the beginning of the paragraph. This is most useful for branch insets, for example, which may contain long paragraphs.
This commit is contained in:
parent
44e09b223e
commit
79dcf402b1
@ -2292,11 +2292,13 @@ void BufferView::setCursorFromRow(int row)
|
||||
// we need to make sure that the row and position
|
||||
// we got back are valid, because the buffer may well
|
||||
// have changed since we last generated the LaTeX.
|
||||
DocIterator const dit = buffer_.getParFromID(tmpid);
|
||||
DocIterator dit = buffer_.getParFromID(tmpid);
|
||||
if (dit == doc_iterator_end(&buffer_))
|
||||
posvalid = false;
|
||||
else if (dit.depth() > 1) {
|
||||
// We are an inset.
|
||||
// We are in an inset.
|
||||
pos_type lastpos = dit.lastpos();
|
||||
dit.pos() = tmppos > lastpos ? lastpos : tmppos;
|
||||
setCursor(dit);
|
||||
recenter();
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user