-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Automatically remove editors for deleted files #894
Conversation
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.
LGTM
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.
Tested on Windows and Linux and this fixes #648 for me in the following cases:
- Saved sketch
- New sketch
- Pulling to remote sketchbook after file deletion on Arduino Cloud
However, I did encounter a problem with unsaved sketches.
I don't know whether this would be considered in scope for this PR, or if it is more that this PR is only allowing us to reach a bug that has always existed, which should be fixed separately.
- Select File > Preferences... from the Arduino IDE menus.
- Uncheck the box next to "🗹 Auto save".
- Click the OK button.
- Click the downward pointing triangle button on the right side of the editor toolbar.
- Select "New Tab" from the menu.
- In the "Name for new file" field, type
foo
. - Click the OK button.
The sketch will now contain a "foo.ino" tab. - Add some text to the "foo.ino" editor to make it "dirty".
(added tab is saved even with auto save off, but that is an unrelated bug) - Click the downward pointing triangle button on the right side of the tab bar.
- Select "Delete" from the menu.
- Click the OK button on the "Move File to Trash" dialog.
🐛 I am presented with this perplexing dialog:
- Don't save - file is deleted, tab is removed from editor
- Cancel/X icon - file is deleted, tab is left in the editor with the "(deleted)" state
- Save - file is preserved, 🙁 tab is removed from the editor
Since the user has already been asked for confirmation about the deletion in the "Move File to Trash" dialog, I don't see any value in this additional "Do you want to save the changes you made to foo.ino (deleted)?" dialog.
@AlbyIanna You're right, I will address this issue in #893 probably 👍 |
cf6a742
to
7c5eb6f
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.
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.
LGTM! 🚀
Motivation
Closes #648
Change description
Listens to any changes of open editors and removes them if the
type
indicates that the underlying file has been deleted.Reviewer checklist