mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Improve caret position when splitting a view
The old code only worked for toplevel cursors and did not show current cursor. Note that the two windows do not have exactly the same offset. Fixes bug #12689.
This commit is contained in:
parent
f833e5f184
commit
e651e15a99
@ -4879,12 +4879,8 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
|||||||
TabWorkArea * twa = addTabWorkArea();
|
TabWorkArea * twa = addTabWorkArea();
|
||||||
GuiWorkArea * wa = twa->addWorkArea(*doc_buffer, *this);
|
GuiWorkArea * wa = twa->addWorkArea(*doc_buffer, *this);
|
||||||
|
|
||||||
// set cursor to same position as current view.
|
wa->bufferView().setCursor(bv->cursor());
|
||||||
// TODO: would be good to *scroll* to same position also
|
dr.screenUpdate(Update::ForceAll | Update::FitCursor);
|
||||||
// so that the display is the same (#12689)
|
|
||||||
DocIterator cur = bv->cursor();
|
|
||||||
wa->bufferView().moveToPosition(cur.pit(), cur.pos(), 0, 0);
|
|
||||||
|
|
||||||
setCurrentWorkArea(wa);
|
setCurrentWorkArea(wa);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user