kana / vim-textobj-line

Vim plugin: Text objects for the current line
http://www.vim.org/scripts/script.php?script_id=3886
178 stars 7 forks source link

This textobj plugin is invalid now? #4

Closed Vesion closed 9 years ago

Vesion commented 9 years ago

This textobj-line plugin is invalid now. I checked the code and found that the ''select-a-function" and "select-i-function" in plugin/textobj/line.vim are surrounded with * for unknown reason, resulting in textobj#user#plugin function finding invalid keys. Remove the asterisks to put this plugin on the working way.

kana commented 9 years ago

Do you have any problem? It still works for me.

Vesion commented 9 years ago

Sorry, perhaps my description was not very clear. This plugin cannot work for me before. So I changed the code in plugin/textobj/line.vim from

call textobj#user#plugin('line', { \ '-': { \ 'select-a': 'al', 'select-a-function': 'textobj#line#select_a', \ 'select-i': 'il', 'select-i-function': 'textobj#line#select_i', \ }, \ })

to

call textobj#user#plugin('line', { \ '-': { \ 'select-a': 'al', 'select-a-function': 'textobj#line#select_a', \ 'select-i': 'il', 'select-i-function': 'textobj#line#select_i', \ }, \ })

(I removed the asterisks.) so that it woks well now. I have no idea why were asterisks there before.

kana commented 9 years ago

The asterisks are used in old versions of vim-textobj-user, but they are still available at the moment. So it's strange that the plugin did not work on your environment. Would you mind pasting the error message you saw and what versions of plugins you used? Anyway, I'll update the old names later.

kana commented 9 years ago

I've fixed. https://github.com/kana/vim-textobj-line/commit/7905467f977b0bbd4d133561ce5a9cbf5d6d1f5b