mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 21:40:19 +00:00
transfer cursor position saving (in the session) from ~WorkArea to ~BufferView.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19719 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
a0e5ee9fac
commit
8202f63160
@ -142,6 +142,14 @@ BufferView::BufferView(Buffer & buf)
|
||||
|
||||
BufferView::~BufferView()
|
||||
{
|
||||
// current buffer is going to be switched-off, save cursor pos
|
||||
// Ideally, the whole cursor stack should be saved, but session
|
||||
// currently can only handle bottom (whole document) level pit and pos.
|
||||
// That is to say, if a cursor is in a nested inset, it will be
|
||||
// restore to the left of the top level inset.
|
||||
LyX::ref().session().lastFilePos().save(
|
||||
support::FileName(buffer_.fileName()),
|
||||
boost::tie(cursor_.bottom().pit(), cursor_.bottom().pos()) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "Font.h"
|
||||
#include "FuncRequest.h"
|
||||
#include "Language.h"
|
||||
#include "LyX.h"
|
||||
#include "LyXFunc.h"
|
||||
#include "LyXRC.h"
|
||||
#include "MetricsInfo.h"
|
||||
@ -90,16 +89,6 @@ WorkArea::~WorkArea()
|
||||
bufferChangedConnection_.disconnect();
|
||||
bufferClosingConnection_.disconnect();
|
||||
|
||||
// current buffer is going to be switched-off, save cursor pos
|
||||
// Ideally, the whole cursor stack should be saved, but session
|
||||
// currently can only handle bottom (whole document) level pit and pos.
|
||||
// That is to say, if a cursor is in a nested inset, it will be
|
||||
// restore to the left of the top level inset.
|
||||
Cursor & cur = buffer_view_->cursor();
|
||||
LyX::ref().session().lastFilePos().save(
|
||||
support::FileName(buffer_view_->buffer().fileName()),
|
||||
boost::tie(cur.bottom().pit(), cur.bottom().pos()) );
|
||||
|
||||
delete buffer_view_;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user