machakann / vim-sandwich

Set of operators and textobjects to search/select/edit sandwiched texts.
1.44k stars 37 forks source link

Delete surrounding triple quote in ruby files clears all text #97

Open PROgram52bc opened 4 years ago

PROgram52bc commented 4 years ago

I just noticed this happening, but not sure what caused it. It is only a problem in Ruby file (not in python) as far as I know, so probably has to do with vim's native support for Ruby?

To reproduce, open vim with some *.rb file, paste the following text:

text = """ Below is an add function """
def add(a, b)
    return a + b
end

Move the cursor to any of the following position

text = """ Below is an add function """
           ^^^^^^^^^^^^^^^^^^^^^^^^

and in normal mode, press sdi and then enter """ for both prompts. Then the entire buffer should be cleared.

Defining a custom mapping with

{'buns': ['"""', '"""'], 'input': ['q']}

and do sdq would produce the same result.

machakann commented 4 years ago

Thank you for your report! Unfortunately, I could not reproduce the problem in my environment. Do you have any other settings related? Or if you could make a minimum working vimrc it would be great.

sandwich_issue97

PROgram52bc commented 4 years ago

It seems that when set foldmethod=syntax, the problem would occur. Otherwise it works fine on my machine as well :)

machakann commented 4 years ago

Thanks, I reproduced.