-
-
Notifications
You must be signed in to change notification settings - Fork 90
Less save prompts #702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Less save prompts #702
Conversation
I agree it's annoying.
Right now for each session, we have a setting edited that defaults to false.
As soon as there is a change to one of the source view, it is set to true.
It's fine except that formatting or "Run" will set edited to true. We can fix that. GtkSourceView has a way to distinguish between user and non-user changes IIRC.
An other option is to store the name of the demo in the session and compare the content of the session with the content of the demo. It would be done here:
https://github.com/sonnyp/Workbench/blob/5486d703b050ca00d262a20dca03b480f9567617/src/window.js#L515
In which case we could create an "isEdited" function that would take care of it.
I'm not sure which one is best. The second option is probably easier / less maintenance effort.
If the demo was edited by Workbench between the time the user opened it and the user closed it – we will ask for confirmation, but I think that's fine, maybe even desirable.
TDLR: I'm not sure which approach is best, let me think about it and feel free to share your thoughts
UrtsiSantsi
commented
Jan 19, 2024
Now there is a save prompt for all the demos without even running them (except for Welcome).
This is Workbench 45.4.
Currently there are 3 issues:
This pull request solves the first 2 issues, but I'm not sure what to do with the last one - trim the empty line after formatting or add one to all the sources?