neovim icon indicating copy to clipboard operation
neovim copied to clipboard

'keywordprg': pass count as first argument if command doesn't support a range

Open zeertzjq opened this issue 1 year ago • 4 comments

Feature already in Vim?

Yes, Vim 7.4.1833

Feature description

Vim, despite having the same documentation for 'keywordprg', actually implements using an Ex command as 'keywordprg' differently (see https://github.com/vim/vim/issues/10745). Vim passes count as the first argument if it is used, and some Vim plugins (including some runtime plugins shipped with Nvim) assume this behavior even though this is not documented behavior. Since using a range with a command that doesn't support a range is an error anyway, it may be better to pass the count as first argument in this case for compatibility with Vim.

zeertzjq avatar Jul 19 '22 14:07 zeertzjq

I am going to try to tackle this one since it seems like a small beginner issue, if that's alright.

mhanberg avatar Jul 20 '22 02:07 mhanberg

Do you have an example of one of the runtime plugins that uses the undocumented vim behavior?

mhanberg avatar Jul 20 '22 03:07 mhanberg

https://github.com/neovim/neovim/blob/master/runtime/ftplugin/systemd.vim

zeertzjq avatar Jul 20 '22 03:07 zeertzjq

I do want to try and do this, but unsure of the time it will take me (not really a C programmer), so someone else can feel free to do it if there isn't a PR up for this soon.

mhanberg avatar Jul 22 '22 21:07 mhanberg