machakann / vim-sandwich

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

Undefined variable a:tail #34

Open stellarhoof opened 7 years ago

stellarhoof commented 7 years ago

Using NVIM v0.2.0-427-gd3b4764d on OS X. Minimal .vimrc:

call plug#begin(g:plugdir)
Plug 'https://github.com/machakann/vim-sandwich'
Plug 'https://github.com/vim-scripts/visualrepeat'
call plug#end()
(textobj-sandwich-auto-i)
(textobj-sandwich-auto-i)
(textobj-sandwich-auto-i)

Stand inside the parentheses in the first line of the snippet above and do sd), u, <C-V>jj$.

Expected result:

textobj-sandwich-auto-i
textobj-sandwich-auto-i
textobj-sandwich-auto-i

Actual result:

:call setpos('.', a:tail)
E121: Undefined variable: a:tail

It doesn't happen with sd), j, <C-V>j$.

The relevant code is in vim-sandwich/autoload/textobj/sandwich/stuff.vim

machakann commented 7 years ago

Hi, thank you for your report.

I have reproduced the problem but it looks very strange error. Probably I also need to check visualrepeat.vim inside, to find the reason. Please wait a little.