From ba2e94d223d6cf4bd2594f6f2b2bfeb2aaa29368 Mon Sep 17 00:00:00 2001 From: Edwin Pujols Date: Sun, 29 Nov 2020 19:56:15 -0400 Subject: runtime: Fix man.vim count handling. Here I use a negative number to decide whether the count has been explicitly set. I think it unlikely that negative sections will ever be created given that negative numbers complicate argument handling: ``` $ man -1 foo man: invalid option -- '1' ``` and given that there's already precedence for alphanumeric sections like `3p`, `3x`, `n`, etc. --- This does work, though: ``` $ man -S -3 baz ``` With `man baz.-3` and `man 'baz(-3)'`, (GNU) man *might* consider `-3` internally as a section, but in the end reports as if the whole argument was the name of a topic: ``` $ man 'baz(-3)' No manual entry for baz(-3) ``` --- Closes #13411. --- runtime/plugin/man.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/plugin') diff --git a/runtime/plugin/man.vim b/runtime/plugin/man.vim index e762eb3664..689aa32ef3 100644 --- a/runtime/plugin/man.vim +++ b/runtime/plugin/man.vim @@ -5,9 +5,9 @@ if exists('g:loaded_man') endif let g:loaded_man = 1 -command! -bang -bar -range=0 -complete=customlist,man#complete -nargs=* Man +command! -bang -bar -range=-1 -complete=customlist,man#complete -nargs=* Man \ if 0 | set ft=man | - \ else | call man#open_page(v:count, v:count1, , ) | endif + \ else | call man#open_page(, , ) | endif augroup man autocmd! -- cgit