You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement a custom text editor webview, based on the cat scratch example. Running the example, if you...
Run the custom extension
Create a new .cscratch document
Add a new scratch
Close the extension window without saving (I guess simulating a crash)
Re-run the editor
The document will appear to be "dirty" in the UI. However, saving will not clear the dirty flag, and any changes that happened between saving and the "crash" seem to be lost.
I tried setting a breakpoint inside the resolveCustomTextEditor function, and interestingly the document isDirty property is false here. So it makes sense somehow that saving wouldn't clear the dirty flag, since the underlying document probably just ignores the command. However, it looks like the UI still knows there are some changes in some buffer somewhere that aren't being saved.
One last data point that might be useful, the issue doesn't seem to be related to using getState and setState—if you get rid of these entirely, and rely completely on the underlying text document as the single source of truth with respect to state, the issue persists.
Here's a gif that shows saving not clearing the dirty flag.
The text was updated successfully, but these errors were encountered:
Extension sample
custom-editor-sample
VS Code version
Version: 1.87.2 (Universal) Commit: 863d2581ecda6849923a2118d93a088b0745d9d6
What went wrong?
I'm trying to implement a custom text editor webview, based on the cat scratch example. Running the example, if you...
I tried setting a breakpoint inside the resolveCustomTextEditor function, and interestingly the document isDirty property is false here. So it makes sense somehow that saving wouldn't clear the dirty flag, since the underlying document probably just ignores the command. However, it looks like the UI still knows there are some changes in some buffer somewhere that aren't being saved.
One last data point that might be useful, the issue doesn't seem to be related to using getState and setState—if you get rid of these entirely, and rely completely on the underlying text document as the single source of truth with respect to state, the issue persists.
Here's a gif that shows saving not clearing the dirty flag.
The text was updated successfully, but these errors were encountered: