aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-01-18 02:45:46 +0800
committerGitHub <noreply@github.com>2022-01-17 11:45:46 -0700
commitad2dbd4b5f2cfa740e373fff0e021e2163909cfb (patch)
tree71c69146ccd6e0b7e1683d653b7be1c7fda4dc27
parent70db972e5fbcab39946ad8ac05472a693cf65b68 (diff)
downloadrneovim-ad2dbd4b5f2cfa740e373fff0e021e2163909cfb.tar.gz
rneovim-ad2dbd4b5f2cfa740e373fff0e021e2163909cfb.tar.bz2
rneovim-ad2dbd4b5f2cfa740e373fff0e021e2163909cfb.zip
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.
-rw-r--r--runtime/autoload/man.vim6
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim
index a954e1b1a3..b28170b7a1 100644
--- a/runtime/autoload/man.vim
+++ b/runtime/autoload/man.vim
@@ -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.
- let results = split(s:system(['man', s:find_arg, a:sect, 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 ''