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

Surround replacement of quotes adds unwanted whitespace #1298

Closed
hmps opened this issue Feb 14, 2017 · 3 comments
Closed

Surround replacement of quotes adds unwanted whitespace #1298

hmps opened this issue Feb 14, 2017 · 3 comments

Comments

@hmps
Copy link

hmps commented Feb 14, 2017

Since commit 75e2cae extra whitespace is added when using Surround to add / modify quotes.


What did you do?

"Hello |World"
Press: cs"'

What did you expect to happen?

"Hello World" => 'Hello World'

What happened instead?

"Hello World" => ' Hello World '

Technical details:

In commit 75e2cae, quotes were added to PairMatcher with nextMatchIsForward set to true. This causes the logic in GetStartAndEndReplacements (actions.ts) to add the whitespace.

  • VSCode Version: 1.9.1
  • VsCodeVim Version: 0.5.3
  • OS: macOS 10.12.3
@xconverge
Copy link
Member

perfect investigation, I am not sure the best way to fix this but it is easily fixable. Will see what @johnfn thinks about the fixes in my pr

@johnfn johnfn closed this as completed in 1618d2c Feb 15, 2017
@hmps
Copy link
Author

hmps commented Feb 15, 2017

Hehe, that was a simple fix. Thank you so much for fixing that so promptly @xconverge!

@xconverge
Copy link
Member

@hmps yea there were quite a few other improvements done to surround so it should be pretty solid now, I will take another pass in the future if there are more small things found

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