-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Notebook shows dirty indicator with autosave on #140069
Comments
I guess this is #96400 |
We never did that for custom editors because it requires code to ensure that an editor that is closed but pending to be saved via auto save is really waited upon on shutdown. To further explain:
Files implement this here: vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorInput.ts Lines 279 to 294 in 4cd3294
I think the reason we never adopted this for notebooks as that notebooks have a dual model: complex and simple. With simple (which is based on file working copies), we can probably implement this now similar to what files do, but it needs careful testing what happens when you close a notebook quickly enough before auto save finished. |
We could revisit this once we remove complex notebook model and friends #144810 but the saving of notebooks is more complex than files and I wonder if it's worth it to implement this. Also the dirty indicator is also an indicator that saving is not done yet, which is valuable as saving notebooks is not necessarily instant. what do you think @roblourens ? |
I think it's ok to close if this is complicated. It's also a bit odd that if I edit and immediately close the tab, it asks me whether I want to save, when I've enabled autosave. |
@amunger with your recent changes in #187304 and #187302 please take note of #140069 (comment). Specifically: being able to close an editor that is now not dirty because of auto-save may result in data loss if closing the editor disposes state that is needed for saving. Filed #188452 as planned for July. Nevertheless, I appreciate that you are willing to look into this issue 🙏 |
The text was updated successfully, but these errors were encountered: