Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
UrtsiSantsi wants to merge 2 commits into main
base: main
Choose a base branch
Loading
from less_save_prompts
Open

Less save prompts #702

UrtsiSantsi wants to merge 2 commits into main from less_save_prompts

Conversation

@UrtsiSantsi
Copy link
Contributor

@UrtsiSantsi UrtsiSantsi commented Oct 23, 2023

Currently there are 3 issues:

  1. Formatted text is set to the GtkSourceView buffer, even if it is the same, raising safe notification.
  2. UI XML is formatted is and set to the previously empty GtkSourceView buffer, even if the selected language is Blueprint.
  3. The .js and .css files don't have empty line at the end, but formatting them adds one.

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?

Copy link
Contributor

sonnyp commented Oct 29, 2023
edited
Loading

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

Copy link
Contributor Author

Now there is a save prompt for all the demos without even running them (except for Welcome).
This is Workbench 45.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sonnyp sonnyp Awaiting requested review from sonnyp sonnyp is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /