SpartanJ / ecode

Lightweight multi-platform code editor designed for modern hardware with a focus on responsiveness and performance.
MIT License
924 stars 13 forks source link

Feature request: session snapshot & periodic backup #220

Closed orjanv closed 2 months ago

orjanv commented 6 months ago

Would be nice with autosave.

SpartanJ commented 6 months ago

Can you describe how exactly should behave? Any open-buffer with modifications should be retained? Any new file also should be restored even if the user never saves it? ecode is project oriented, how it should behave if you not open a project / folder and just a single file, should load all previously loaded files without a project? Thanks

orjanv commented 6 months ago

I realize that I cannot open an empty tab in the editor, it is only possible to open a new file, like touch and then it will not be a case of autosaving a buffer. Unsaved modifications on open files perhaps, but then again, I'm warned on unsaved upon exit:

image

I have used thonny and notepad++ where I can open a new tab without assigning it to a filename, just an unsaved note, which n++ would keep if closed. This last part was in my mind i guess.

orjanv commented 6 months ago

Actually, I could open a new tab cith ctrl+t

image

SpartanJ commented 6 months ago

 I have used thonny and notepad++ where I can open a new tab without assigning it to a filename, just an unsaved note, which n++ would keep if closed. This last part was in my mind i guess.

Perfect. Yes, currently ecode will just alert the user that the document will be lost of not saved. Notepad++ doesn't have projects / folders so we would need to have a different behaviour. I think that what it makes more sense is: keep unsaved files from "non-project" files open on non-project context and keep unsaved files from each open project separately. So if you open a project and last time was closed with unsaved files they'll be restored, and if you open ecode without any open folder it will restore the files from that previous context.

ghost commented 6 months ago

@orjanv Is what you are asking for similar to the autosave plugin of Lite XL and Pragtical?

SpartanJ commented 3 months ago

Done, this is called "Session Snapshot & Periodic Backup" in Notepad++, I've used the same name since it makes more sense, auto-save is a different thing.