adamerose / vscode-markdown-wysiwyg

https://marketplace.visualstudio.com/items?itemName=adamerose.markdown-wysiwyg
Other
14 stars 4 forks source link

De-Activate extension Behavior #3

Closed sjsepan3 closed 1 year ago

sjsepan3 commented 1 year ago

Related to #2 https://github.com/adamerose/vscode-markdown-wysiwyg/issues/2...

When de-activating extension (w/ Ctrl+Shift+E)(not Disable, not Uninstall) after experiencing issue with Undo, file is written without prompting user. If user does not Undo again to reverse the disappearing content, and re-save, their content will be gone, and they may not discover it until the app is closed. User will likely notice the disappeared content (as I did in reporting #2) but when they close the document and choose not to save changes, they will not realize that it is already too late (empty file is saved).

adamerose commented 1 year ago

Okay I removed the autosaving, it will prompt the user with the save dialog when toggling the editor on an unsaved file.

The ideal behavior would be to toggle between editors without saving and without showing a popup prompt, just keep the file dirty, but I think this isn't possible with the current VS Code API. I already have a note about this in NOTES.md

sjsepan3 commented 1 year ago

v1.7.4: re-testing - this does prevent unexpected loss of data. One disconcerting side-effect is that during the save prompt, a second copy of the tab appears.

This is probably related to trying to solve the disappearing tab issue you mentioned in vscode #169921.

adamerose commented 1 year ago

One disconcerting side-effect is that during the save prompt, a second copy of the tab appears. This is probably related to trying to solve the disappearing tab issue you mentioned in vscode #169921.

You're right it's related to the workaround for the flickering. I do think the second tab appearing when unsaved is more annoying then the flickering, so I'm reverting that in 0.7.5 and no longer using the deprecated .hide method.

When and if this gets resolved I will switch to the new API