mirror of
https://github.com/neovim/neovim.git
synced 2024-12-31 17:13:26 -07:00
fix(man.vim): support calling :Man without a section again (#17119)
When `man -w` is called with an empty string as section name, it may fail with an error code, which causes :Man to no longer work without a section. Just remove that argument when no section is specified.
This commit is contained in:
parent
70db972e5f
commit
ad2dbd4b5f
@ -232,7 +232,11 @@ function! s:get_path(sect, name) abort
|
||||
"
|
||||
" Finally, we can avoid relying on -S or -s here since they are very
|
||||
" inconsistently supported. Instead, call -w with a section and a name.
|
||||
if empty(a:sect)
|
||||
let results = split(s:system(['man', s:find_arg, a:name]))
|
||||
else
|
||||
let results = split(s:system(['man', s:find_arg, a:sect, a:name]))
|
||||
endif
|
||||
|
||||
if empty(results)
|
||||
return ''
|
||||
|
Loading…
Reference in New Issue
Block a user