-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
No save dialog if another widget shares identical model #10614
Conversation
8f69c1e
to
f129560
Compare
f129560
to
cc661f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks code to me, and the functionality of this change as well:
- Opening multiple editors for the same model (splitting) continues to work correctly
- Closing a dirty editor whose model is shared with another widget does not prompt a confirmation message
- Using the
Close All
context menu entry closes all duplicated editor models of the same group, exactly replicating the behavior of vscode - Closing the last instance of a dirty editor model prompts a confirmation message, as well as closing the app.
Thanks, @msujew. I'll merge this after the release. |
cc661f5
to
160276c
Compare
@vince-fugnitto, I've disabled the |
@colin-grant-work please consider merging/squashing the following instead: #10688 This way you can squash and merge the current PR without the noise from skipping that failing test. |
@colin-grant-work you can now remove 52da73d as #10688 got merged :) |
52da73d
to
64f85e3
Compare
What it does
Fixes #9474 by modifying
Saveable.apply
to accept a function to generate a list of widgets that may share the same underlying saveable resource as the widget being closed. If any widget does, then the widget is closed without saving and without reverting the saveable's state.How to test
The tricky part is the multi-close commands, close all, close others, and close to the right.
Review checklist
Reminder for reviewers