From: Daniel Ramoeller Date: Mon, 6 Mar 2023 20:44:59 +0000 (+0100) Subject: Keep cursor position when splitting X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a2310d04f47ba6aadea0e43ffc1e8a8579110022;p=features.git Keep cursor position when splitting Fix for #12689 --- diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp index 844ef90d07..c02c479d16 100644 --- a/src/frontends/qt/GuiView.cpp +++ b/src/frontends/qt/GuiView.cpp @@ -4880,6 +4880,8 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr) ? Qt::Vertical : Qt::Horizontal); TabWorkArea * twa = addTabWorkArea(); GuiWorkArea * wa = twa->addWorkArea(*doc_buffer, *this); + DocIterator cur = bv->cursor(); + wa->bufferView().moveToPosition(cur.pit(), cur.pos(), 0, 0); setCurrentWorkArea(wa); break; }