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

Space is trimmed when replacing delimiter of string literal contains trailing space #33

Open
rhysd opened this issue Oct 21, 2017 · 0 comments
Labels

Comments

@rhysd
Copy link
Owner

rhysd commented Oct 21, 2017

When cursor is on 'f',

puts 'foo '

<Plug>(operator-surround-replace)a'" will change above code to:

puts "foo" 

Note that the line has one trailing space at the end of line. So 'foo ' is modified to "foo" .

This occurs because replacing is implemented as a combination of deleting and appending a surround. It deletes the surrounding ' at first(foo ), and then appends surrounding " next("foo" ). When appending the surround, the space is not counted as surrounding and only 'foo' is considered as target.

@rhysd rhysd added the bug label Oct 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant