-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Don't run setDirty while IME input is unconfirmed. #164366
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
base: main
Are you sure you want to change the base?
Don't run setDirty while IME input is unconfirmed. #164366
Conversation
…not yet finalized. microsoft#164351
… to be entered into undo/redo.
Fixes #164351 (comment)
This commit can be applied independently of the first commit. |
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.
This is a huge change that brings the knowledge of IME (via the unconfirmed flag) to the world. I am not convinced of doing something very special for IME here. Also the file is dirty when not using IME and pressing for example A and then pressing Backspace. In other words, the dirty flag is not text buffer content based.
The proposed change is huge and I think a much more elegant solution would be to do something around equality. Perhaps we can compute the text model's sha1 in the web worker or something like that.
Thank you for your review. There were too many changes to propagate the unconfirmed flag. I will PR again when I come up with a solution with fewer changes. What about my second comment: #164366 (comment) I think this commit has relatively few changes. |
I think the right way to go here is to change the isDirty implementation in the workbench to be content based. Perhaps the TextFileEditorModel could remember the |
Fixes #164351
The following process has been added to solve this issue.
https://github.com/guttyon/vscode/blob/f0323c2e67fc6506f0b67cd821ea4f6036063a56/src/vs/editor/browser/controller/textAreaInput.ts#L312
https://github.com/guttyon/vscode/blob/f0323c2e67fc6506f0b67cd821ea4f6036063a56/src/vs/editor/browser/controller/textAreaInput.ts#L343
https://github.com/guttyon/vscode/blob/f0323c2e67fc6506f0b67cd821ea4f6036063a56/src/vs/workbench/services/textfile/common/textFileEditorModel.ts#L606
https://github.com/guttyon/vscode/blob/f0323c2e67fc6506f0b67cd821ea4f6036063a56/src/vs/editor/common/cursor/cursorTypeOperations.ts#L285