mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +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
|
int BufferView::defaultMargin() const
|
||||||
{
|
{
|
||||||
// The value used to be hardcoded to 10
|
// The value used to be hardcoded to 10
|
||||||
|
@ -108,6 +108,9 @@ public:
|
|||||||
Buffer & buffer();
|
Buffer & buffer();
|
||||||
Buffer const & buffer() const;
|
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; }
|
void setFullScreen(bool full_screen) { full_screen_ = full_screen; }
|
||||||
|
|
||||||
|
@ -4879,8 +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);
|
||||||
|
|
||||||
wa->bufferView().setCursor(bv->cursor());
|
wa->bufferView().copySettingsFrom(*bv);
|
||||||
dr.screenUpdate(Update::ForceAll | Update::FitCursor);
|
dr.screenUpdate(Update::ForceAll);
|
||||||
setCurrentWorkArea(wa);
|
setCurrentWorkArea(wa);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user