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

Whitespace removal becomes part of undo stack #2

Open
atombender opened this issue Dec 2, 2016 · 2 comments · May be fixed by #4
Open

Whitespace removal becomes part of undo stack #2

atombender opened this issue Dec 2, 2016 · 2 comments · May be fixed by #4
Labels

Comments

@atombender
Copy link

For example: Say you have this:

hello world

Select world and hit Enter once. Hit undo. Nothing will apparently happen because what's being undone is the trailing whitespace after "hello". If you enable rendering of whitespace, it becomes apparent that when hitting enter, the whitespace is removed after you hit enter.

I don't know if VSCode offers the necessary plumbing to ensure that the removal of whitespace either isn't a separate step in the undo stack or is grouped together with the last edit operation. Either way, this is very annoying, since I expect "undo" to only undo what I did, not the automatic trimming.

@axefrog
Copy link
Owner

axefrog commented Dec 3, 2016

I am out at the moment, but I'll make an update as soon as I get a chance. You're right, it looks like the API supports this behaviour. The line of code to change is here if you want to make the change before I get to it.

@axefrog axefrog added the bug label Dec 3, 2016
@atombender
Copy link
Author

That's great news! I'm too busy to switch contexts right now, but thanks for the documentation pointer.

ChristianKurz added a commit to ChristianKurz/vscode-autotrim that referenced this issue Feb 20, 2018
This should fix axefrog#2 by not adding an undostop after the whitespace-removal.

I didn't test this on my machine, so please review.
@ChristianKurz ChristianKurz linked a pull request Feb 20, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants