Skip to content
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

[VSCode] Change in behaviour of undo operations. #60

Open
akenejie opened this issue Aug 31, 2024 · 3 comments
Open

[VSCode] Change in behaviour of undo operations. #60

akenejie opened this issue Aug 31, 2024 · 3 comments

Comments

@akenejie
Copy link
Contributor

In VSCode, when someone performs an undo operation, it is passed on to other editors as a simple change, and when others perform further undos, it becomes an ‘undo what was undone’ operation.

Ideally, the undo operation should apply to the user's own operations and not those of others.

@msujew
Copy link
Contributor

msujew commented Aug 31, 2024

Unfortunately, there's little we can do here - we use the vscode.workspace.applyEdits API, which is the only API that allows to perform edits on open text documents. All edits sent to the applyEdits method are automatically pushed to the undo-redo stack. There is no way to change this behavior.

Closing, as it's a technical limitation of the VS Code API.

@msujew msujew closed this as completed Aug 31, 2024
@akenejie
Copy link
Contributor Author

Sorry.

So, could you use a when expression and define a custom Ctrl+Z command to implement a function that stacks when it receives other people's operations from the server and only undo its own operations that are not received from the server?

@msujew
Copy link
Contributor

msujew commented Aug 31, 2024

I guess we could try that, but I can't promise this works well.

@msujew msujew reopened this Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants