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

Fix #2168: Surround offset #2171

Merged
merged 3 commits into from
Nov 22, 2017
Merged

Fix #2168: Surround offset #2171

merged 3 commits into from
Nov 22, 2017

Conversation

westim
Copy link
Contributor

@westim westim commented Nov 22, 2017

This fixes the extra whitespace created when the ysaw and ysw commands are used.

As explained in 56371b6, this occurs because the yaw and yw commands normally yank the trailing whitespace after the current word. In this surround case, we want to ignore that extra character and modify the ending cursor position accordingly.

I have added 6 new tests to cover these scenarios.

In Vim, the commands `yw` and `yaw` will also yank any trailing
whitespace. However, during a surround command `ysaw`, we want to
exclude that whitespace to avoid an offset.
@Chillee
Copy link
Member

Chillee commented Nov 22, 2017

Aghhhh!!! All of these have a space/don't have a space/have a new line at the beginning/end permutations are so annoying to deal with.

Thanks!

@Chillee Chillee closed this Nov 22, 2017
@Chillee Chillee reopened this Nov 22, 2017
@Chillee Chillee merged commit 26d77e8 into VSCodeVim:master Nov 22, 2017
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

Successfully merging this pull request may close these issues.

2 participants