The main idea is to save the session file list more often to prevent accidental lost but saving the rest of the configuration might help as well. To prevent too many save attempts, an idle function is used and it's only added once until it was executed.
This might help #1826, #1426 and replaces #1860.
IIRC at the very beginning I was a bit concerned about IO access and performance when writing the settings too often. At least performance doesn't seem to be a problem: `configuration_save` takes about 1-2 milliseconds on my system and IO access happens in the document-related actions in any way.
Even though I tested the code, I would like to use it "in production" for some time to get sure there are no unseen side effects or similar. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2114
-- Commit Summary --
* Save main and project configuration whenever documents are opened/closed
-- File Changes --
M src/keyfile.c (38)
-- Patch Links --
https://github.com/geany/geany/pull/2114.patch https://github.com/geany/geany/pull/2114.diff