mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
man.vim: use -range instead of -count (#5203)
With -count, if the first argument is a number, it is made available with <count>. Problem is, there is always a default count it is impossible to tell whether the user set it. Since v:count and v:count1 still work with 'keywordprg', -count is unnecessary. But 'keywordprg' still calls ':Man' with a count prefixed. So it must still accept a count in the line number position, but not consume the first argument. This is done with -range. Fixes #5202.
This commit is contained in:
parent
3e26c32994
commit
3ff252ca86
@ -5,7 +5,7 @@ if exists('g:loaded_man')
|
||||
endif
|
||||
let g:loaded_man = 1
|
||||
|
||||
command! -count=0 -complete=customlist,man#complete -nargs=+ Man call man#open_page(v:count, v:count1, <f-args>)
|
||||
command! -range=0 -complete=customlist,man#complete -nargs=+ Man call man#open_page(v:count, v:count1, <f-args>)
|
||||
|
||||
nnoremap <silent> <Plug>(Man) :<C-U>call man#open_page(v:count, v:count1, &filetype ==# 'man' ? expand('<cWORD>') : expand('<cword>'))<CR>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user