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

Vim Surround add (e.g. ysbB) is erroneous: ends in wrong place and adds spaces #6006

Closed
corneliusroemer opened this issue Jan 17, 2021 · 2 comments

Comments

@corneliusroemer
Copy link

Describe the bug
Vim Surround add doesn't work how it should: the closing part ends up where the cursor started, not where it should end according to the surround logic. Additionally, there are spaces inserted, which shouldn't be the case.

To Reproduce

  1. Cursor starts on c of (abcdefg)
  2. Press: ys({

Actual Behaviour
{ (ab }cdefg

Expected behavior
{(abcdefg)}

Screenshots
yanksurround

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.18.5
  • VS Code Version: 1.52.1 (user setup)
  • OS: Windows_NT x64 10.0.18363
@sql-koala
Copy link
Contributor

Osi-Schicht 8 Fehler ;-)
Probier es mit: ysa(}
Für die Klammer musst du das textobject a( angeben. Der whitespace bei "{" ist ein feature, "}" macht ohne space.

Grüße

@corneliusroemer
Copy link
Author

Oh dear, you're totally right...

For some reason I didn't find surround's proper documentation, it wasn't referenced in the Github readme so I opened an issue over there: tpope/vim-surround#321 (comment)

Could you possibly explain what happens in the case of input of ys(}? Is it undefined behaviour according to surround.vim docs? The ( without preceding i or a stops it from being a text object. So what is it? A text motion to the beginning of the paragraph, right?

With documentation at tpope/vim-surround#321 (comment) it makes sense. Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants