You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the doc, g:operator#surround#ignore_space affects <Plug>(operator-surround-append) and <Plug>(operator-surround-replace), not <Plug>(operator-surround-delete).
Currently, sda' doesn't work with the example below when g:operator#surround#ignore_space = 0 .
(Assume that map sd <Plug>(operator-surround-delete) and _ is the cursor position.)
In this text, va' selects 'example' , not 'example' (please notice last white space). vim-operator-surround tries to find out the surrounding from the text 'example' . When g:operator#surround#ignore_space = 1, the last white space is ignored. So vim-operator-surround finds the first ' and the last ' are pair of delimiters. However, if the variable is set to 0, the last space is not ignored. In this case vim-operator-surround compares the first ' and the last and they are not a pair of delimiters so the 'block not found' error occurs.
Thank you for your explanation, and I understand the behavior.
Now let me explain the behavior I want.
When appending or replacing, g:operator#surround#ignore_space = 0 is useful because I want the selection of example to become 'example ' (not 'example' ).
However, I'm wondering that there are no advantages to applying g:operator#surround#ignore_space = 0 when deleting. (It enables nothing, and only prevent me from deleting what I want, IMO.)
This is why my suggestion is to make g:operator#surround#ignore_space = 0 have no effect to <Plug>(operator-surround-delete).
Of course you can decline it, but then the doc might have to be updated, because it says:
g:operator#surround#ignore_space *g:operator#surround#ignore_space*
If the value is non-zero, surroundings ignores white spaces when they are
added with <Plug>(operator-surround-append) or
<Plug>(operator-surround-replace). <--- Also affects <Plug>(operator-surround-delete)!
The default value is 1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
According to the doc,
g:operator#surround#ignore_spaceaffects<Plug>(operator-surround-append)and<Plug>(operator-surround-replace), not<Plug>(operator-surround-delete).Currently,
sda'doesn't work with the example below wheng:operator#surround#ignore_space = 0.(Assume that
map sd <Plug>(operator-surround-delete)and_is the cursor position.)