I still don't understand. What you want is C::B to automatically copy the file from .save to the original on the next start?
Yes but not "silently". When something (workspace/project/editor) is opened, if a .save file exists, it warn user that an autosaved file exist and ask if it should be used or not. This type of feature is present on some other editors, code or generalist (I agree mainly Microsoft ones ...).
This patch adds tons of complexity to the code, so you'll have to justify it, before it goes in SVN.
Yes, I've opened this topic to share about it because I know it add lot of things/breaks in sdk
Perharps at end of discussion, it's concluded it's not good idea ...
The main objective is, however, that Code::Blocks does not crash in the first place, and we're reasonably close to that objective (I've not seen a crash on my machine for years).
I'm totally agree with objective. But in my usage for 2 years, I found some random crashes or "hangs" that lead to some losts. I'm convinced that some (and even all) are plugins related. If there is no problem, it don't change at all usage of C::B
Having to restore from a save file is something that should rarely happen if ever (I remember having to do it a single time, years ago). It is not something most people will regularly find useful being automated.
The goal is clearly that this plugin never have work to do. It's like all bug reporting feature.
If poeple
know which file should be restored it's ok.
Files poeple are mainly working on are obvious
A minor modification (comment one line) done one hour ago can easily not recover.
A change in project compilation flag can also be forgoten, as one hour after I don't remember that I have ad this DEFINE that enable a small minor change ...
For me it's the most important part, warning that an autosaved file exist for what we open.
Precision : I'm (also) an embedded developper (quite small chips) and it's a part of my usage. There are more projects options (related to compiler option) tweeking in this usage
So patch permit also to load this autosaved one "in place" of original, aka : get things back just before previous crash. File on disk is always original. In memory we have modified one. And at this point user can do what he would do (save, throw away). I've done it because I found this useful, be it can be a bad idea
The code alters the SDK to make the plugin work with its new functionality, and the "complete save" feature uses a boolean as a lock.
Which one do you refer ? As far as I know, I add boolean for "workspace is load", I do that because there is only one workspace loaded at a time ?
I add a boolean in each editor instance and each project instance to says "this file is a recovered copy", because I haven't find any solution for saying "this file is the same as loaded from disk - from .save one, but it really a modified file - so if we close it we should ask if it must be save - to original one".
But I'm new to this part of C::B code so I can have missed lot of things !