mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
When splitting a bufferview, keep the scrollbar position
This is actually better thean making sure that the cursor is visible. Fixes bug #12689.
This commit is contained in:
parent
375bb32a3d
commit
100e759f17
@ -337,6 +337,14 @@ BufferView::~BufferView()
|
||||
}
|
||||
|
||||
|
||||
void BufferView::copySettingsFrom(BufferView const & bv)
|
||||
{
|
||||
setCursor(bv.cursor());
|
||||
d->anchor_pit_ = bv.d->anchor_pit_;
|
||||
d->anchor_ypos_ = bv.d->anchor_ypos_;
|
||||
}
|
||||
|
||||
|
||||
int BufferView::defaultMargin() const
|
||||
{
|
||||
// The value used to be hardcoded to 10
|
||||
|
@ -108,6 +108,9 @@ public:
|
||||
Buffer & buffer();
|
||||
Buffer const & buffer() const;
|
||||
|
||||
/// Copy cursor and vertical offset information from \c bv
|
||||
void copySettingsFrom(BufferView const & bv);
|
||||
|
||||
///
|
||||
void setFullScreen(bool full_screen) { full_screen_ = full_screen; }
|
||||
|
||||
|
@ -4879,8 +4879,8 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
|
||||
TabWorkArea * twa = addTabWorkArea();
|
||||
GuiWorkArea * wa = twa->addWorkArea(*doc_buffer, *this);
|
||||
|
||||
wa->bufferView().setCursor(bv->cursor());
|
||||
dr.screenUpdate(Update::ForceAll | Update::FitCursor);
|
||||
wa->bufferView().copySettingsFrom(*bv);
|
||||
dr.screenUpdate(Update::ForceAll);
|
||||
setCurrentWorkArea(wa);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user