kana / vim-textobj-function

Vim plugin: Text objects for functions
http://www.vim.org/scripts/script.php?script_id=2619
141 stars 34 forks source link

Use normal! everywhere in C object #6

Closed majutsushi closed 11 years ago

majutsushi commented 11 years ago

Some of the normal commands in the C textobj functions didn't use ! and thus would break if the user had remapped them. This patch fixes that.

kana commented 11 years ago

Thank you for the patch. I've merged it.

By the way, several filetype plugins in $VIMRUNTIME overrides [[ and others to move the cursor by a function (or another kind of object). So, if I remembered correctly, I chose :normal to use [[ and ][ which might be customized by other filetype plugins.

But the decision is wrong, because the default filetype plugin for C language doesn't override [[ and others. And this plugin expects the standard behavior of [[ and ][. It doesn't make sense to use :normal here.

majutsushi commented 11 years ago

That's a good point, I hadn't thought of that. But as you said the C ftplugin doesn't do that, and it didn't work for me since I changed the mappings in my vimrc.