pyxel icon indicating copy to clipboard operation
pyxel copied to clipboard

Feature request: editor autosave

Open zoeleu opened this issue 2 years ago • 2 comments

Autosave would be such a nice feature to not lose hours of work to not saving manually. Every 5 minutes would be excellent

zoeleu avatar May 07 '22 01:05 zoeleu

Automatic backups could be nice, but not saving with the original filename — want to keep control on that!

merwok avatar May 07 '22 10:05 merwok

Yes, I think it should be some sort of history, or saving on a pyxel-specific folder.

zoeleu avatar May 07 '22 19:05 zoeleu

Just lost an hour of work over a dumb mistake. It's my fault, sure, but a simple auto backup can't hurt.

zoeleu avatar Apr 06 '23 22:04 zoeleu

@kitao What is your opinion on this feature?

zoeleu avatar Apr 06 '23 22:04 zoeleu

I don't like automatically created files (such as vim's .~ files) that are hard for novice users to understand, or blind use of configuration files. If there is a way to avoid that, I agree with the autosave function.

kitao avatar Apr 14 '23 13:04 kitao

What if an auto saved history is saved inside of the resource file?

zoeleu avatar Apr 14 '23 17:04 zoeleu

I do not agree with that because it enlarges the resource file size and also includes unnecessary data not intended by users.

Going back to the basics of UI design for the tool, I think it is necessary to sort out under what circumstances auto back up is needed in the first place.

It is important to first clarify the reason, such as whether it is because the user forgot to save and quit the application, or because the application is unstable and terminates abnormally, and then determine whether this is the case only for a limited number of users, and consider measures to prevent confusion for novice users.

kitao avatar May 06 '23 02:05 kitao

Using Escape by default to quit without any save prompt is one big negative surprise.

merwok avatar May 06 '23 17:05 merwok

I have a solution for the space, maybe saving the files in the user's data directory like AppData on windows, or .local on linux.

I think this is a measure that cannot have any negative effects of novice user confusion because you don't even need to make an UI to restore the files, only add an entry in the README, or add a --restore-latest CLI parameter.

zoeleu avatar May 06 '23 23:05 zoeleu

Actually the reason why I added the quit shortcut by ESC key is just making debugging easier, so I disable it in the next release.

kitao avatar May 08 '23 02:05 kitao

Could we still look into the original issue of auto saving? I think it would be really beneficial to new users. The space problem is negligible.

For cases where a recovery is prompted, we could check if the program crashed last run, or if the resource is empty and there is a backup (user closed, shut down, ctrl+c on the terminal, accidentally).

zoeleu avatar Jul 14 '23 04:07 zoeleu