-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Untitled editors always saved on close when autosave is active #15501
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
Comments
I didn't understand the issue from the title, so I took the liberty to edit the title. Feel free revert if you disagree. |
Whatever seems more intelligible. Strictly speaking, they aren't 'always saved,' but they won't close if you don't save - your options are save and close or cancel and not close. |
Hmh....but doesn't that kinda make sense: if you don't have a file name, where are you going to save the content? What would the correct behavior be in your opinion? |
With normal (disk-backed) files, this behavior leads to them just being saved directly, because autosave means you're happy not managing their saving. Untitled files are exempt from autosaving, and their 'save' behavior redirects to 'Save As,' which is why the file dialog pops up. To me, the correct behavior for untitled editors would be that you should get the 'Do you want to save' dialog first, and if you choose not to, the editor just closes. That is, you should be able to close without saving: you shouldn't be forced to either save or keep the editor open. |
Bug Description:
When autosave is active, untitled editors are exempted from it. When an untitled editor is closed, however, the logic to determine whether to save the widget or show a prompt to save the widget jumps straight to saving because
autosave
is on:theia/packages/core/src/browser/saveable-service.ts
Lines 205 to 237 in 505c885
Steps to Reproduce:
files.autoSave
preference to anything butoff
Additional Information
The text was updated successfully, but these errors were encountered: