save session when we save a buffer

Implements enhancement #10712.
This commit is contained in:
Alexander Dunlap 2018-02-15 11:28:34 -08:00 committed by Jean-Marc Lasgouttes
parent 110a5e2a15
commit cca365f26c

View File

@ -2263,8 +2263,10 @@ Buffer * GuiView::loadDocument(FileName const & filename, bool tolastfiles)
setBuffer(newBuffer);
newBuffer->errors("Parse");
if (tolastfiles)
if (tolastfiles) {
theSession().lastFiles().add(filename);
theSession().writeFile();
}
return newBuffer;
}
@ -2803,6 +2805,7 @@ bool GuiView::saveBuffer(Buffer & b, FileName const & fn)
bool const success = (fn.empty() ? b.save() : b.saveAs(fn));
if (success) {
theSession().lastFiles().add(b.fileName());
theSession().writeFile();
return true;
}