save session when we save a buffer

Implements enhancement #10712.

(cherry picked from commit cca365f26c)
This commit is contained in:
Alexander Dunlap 2018-02-15 11:28:34 -08:00 committed by Jean-Marc Lasgouttes
parent a2e1021aba
commit 257f978d62
2 changed files with 6 additions and 1 deletions

View File

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

View File

@ -67,6 +67,8 @@ What's new
- Fix display of citation labels when pasting from a document - Fix display of citation labels when pasting from a document
with other citation type (bug 10829). with other citation type (bug 10829).
- Save the list of recent files when a file is open/saved so that it
is up to date after a crash (bug 10712).
* INTERNALS * INTERNALS