A hidden document does not have an associated Cursor. So, each time we create a new workArea, we should restore the cursor position.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35811
a592a061-630c-0410-9148-
cb99ea01b6c8
if (wa == 0) {
newBuffer->masterBuffer()->updateBuffer();
wa = addWorkArea(*newBuffer);
if (wa == 0) {
newBuffer->masterBuffer()->updateBuffer();
wa = addWorkArea(*newBuffer);
+ // scroll to the position when the file was last closed
+ if (lyxrc.use_lastfilepos) {
+ LastFilePosSection::FilePos filepos =
+ theSession().lastFilePos().load(newBuffer->fileName());
+ wa->bufferView().moveToPosition(filepos.pit, filepos.pos, 0, 0);
+ }
} else {
//Disconnect the old buffer...there's no new one.
disconnectBuffer();
} else {
//Disconnect the old buffer...there's no new one.
disconnectBuffer();
- // scroll to the position when the file was last closed
- if (lyxrc.use_lastfilepos) {
- LastFilePosSection::FilePos filepos =
- theSession().lastFilePos().load(filename);
- documentBufferView()->moveToPosition(filepos.pit, filepos.pos, 0, 0);
- }
-
if (tolastfiles)
theSession().lastFiles().add(filename);
if (tolastfiles)
theSession().lastFiles().add(filename);