Closed nhooyr closed 4 years ago
IE the user shouldn't have to think about saving.
Just like Intellij/Xcode etc.
Xcode doesn't autosave...
It does save on exit and on build, yes, but not continuously. Save-on-close could be an option. Building from xi-mac is not possible yet so that part is irrelevant (and would probably be the responsibility of the plugin that deals with building).
My bad, I will clarify. I meant save on lost focus which Xcode
does do and sublime has an option for as well and jet brains IDE's all do by default.
That sounds like a reasonable option. Can you update the issue title and OP to reflect this? Something like "more save triggers". Maybe add a list of checkboxes for the various save scenarios so we can use this as a tracking issue.
The most difficult part about this would be the config I think? The core does not know about focus and not all frontends will have a concept for it so I'm not sure where the setting would belong. @cmyr thoughts?
A timed autosave (every 5 minutes or whatever, might as well make it configurable) could also be okay. Personally I wouldn't use it in xi-mac, especially once state restoration is fully working, but it is a common feature in other applications and certainly holds value for some people.
This doesn't seem too tricky - maybe overriding windowWillResignKey
and calling save in XiWindow would work.
This feels closely related to having state-restoration (https://github.com/xi-editor/xi-editor/issues/913) / autosave implemented in general. I'm not a huge fan of overwriting files on disk until we're asked to explicitly (but maybe having this as an option makes sense) but I agree probably makes sense as a client feature.
Going to close as it has been a while and I'm not sure if this is relevant anymore.
xi-mac should be continuously auto saving files.