thalesmello / vim-textobj-multiline-str

12 stars 0 forks source link

Does not seem to work in neovim #1

Open bergtholdt opened 3 years ago

bergtholdt commented 3 years ago

I tried the plugin in a very current neovim.

I have

Plug 'kana/vim-textobj-user'
Plug 'thalesmello/vim-textobj-multiline-str'

It seems to get activated

:verbose map iq

o  iq           @<Plug>(textobj-multilinestr-python-i)
Last set from ~/.vim/plugged/vim-textobj-user/autoload/textobj/user.vim line 634
x  iq           @<Plug>(textobj-multilinestr-python-i)
Last set from ~/.vim/plugged/vim-textobj-user/autoload/textobj/user.vim line 634
x  i             targets#e('o', 'i', 'i')
Last set from ~/.vim/plugged/targets.vim/plugin/targets.vim line 33
o  i             targets#e('o', 'i', 'i')
Last set from ~/.vim/plugged/targets.vim/plugin/targets.vim line 32
s  i           * <C-O>"_ci
Last set from ~/.vim/plugged/vim-cutlass/autoload/cutlass.vim line 13

But yiq, viq, vaq, etc. don't work, nothing gets selected or yanked. Maybe it does not work with the other plugins I have activated targets, cutlass

Any ideas how to debug this?

thalesmello commented 3 years ago

I use Neovim and I just checked it works with the following example, with :set ft=python.

text = """
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
"""

What version of Neovim are you using?

snorkysnark commented 2 years ago

This is because synstack() doesn't seem to work with treesitter. You have to use ts_utils.get_node_at_cursor() to check if you're inside a python string