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
After I source my vimrc, targets.vim gets some errors for operations on i{text-obj} and a{text-obj} (e.g., diw):
Error detected while processing function targets#e:
line 6:
E714: List required
Error detected while processing function targets#e:
line 12:
E121: Undefined variable: nKeys
Error detected while processing function targets#e:
line 19:
E121: Undefined variable: lKeys
Error detected while processing function targets#e:
line 26:
E121: Undefined variable: nKeys
Error detected while processing function targets#e:
line 26:
E116: Invalid arguments for function s:hasPrefix(nKeys, pending) || s:hasPrefix(lKeys, pending)
This is how I configured the plugin in my vimrc:
letg:targets_nl='nN'
When removing this line, the error disappears.
The text was updated successfully, but these errors were encountered:
victorkristof
changed the title
Error after sourcing vimrc
Error after sourcing vimrc when g:targets_nl is set
Sep 2, 2020
targets.vim changes the value of g:targets_nl to be a list when it is loaded. In this case, that list is ['n', 'N'].
So, if you reset the variable to a string after it is loaded, that results in the error E714: List required.
As a workaround, you can instead use
letg:targets_nl= ['n', 'N']
If you always set it to be a list, then the issue doesn't occur.
IMO, this is still a bug with targets.vim, it really should just do the conversion each time. I would have to imagine that any speed up from doing the conversion once would be premature optimization.
Hi there,
Thank for the great plugin!
After I source my vimrc, targets.vim gets some errors for operations on
i{text-obj}
anda{text-obj}
(e.g.,diw
):This is how I configured the plugin in my vimrc:
When removing this line, the error disappears.
The text was updated successfully, but these errors were encountered: