vim-textobj-user icon indicating copy to clipboard operation
vim-textobj-user copied to clipboard

Doesn't jump to nearest paired text object

Open albert-ying opened this issue 2 years ago • 0 comments

Vim will automatically move the cusor to the next text object when target object is not under cursor.

For example, if you run di" on following example, when cursor is located at first charactor.

Here is the "target"
^

It will autojump to the target and give:

Here is the ""
             ^

This works for the regular textobj defined as

call textobj#user#plugin('quote', {
\   'a': {
\     'pattern': '".*"',
\     'select': ['aB', 'iB'],
\   },
\ })

However, for paired text object, it doesn't work (i.e. cursor does not jump automatically to the next text object when target object is not under cursor)


call textobj#user#plugin('quotep', {
\   'b': {
\     'pattern': ['"', '"'],
\     'select-a': 'aA',
\     'select-i': 'iA',
\   },
\ })


albert-ying avatar Aug 20 '21 00:08 albert-ying