diff options
author | Brayden Banks <bb010g@gmail.com> | 2018-07-08 08:31:10 -0700 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-07-08 17:31:10 +0200 |
commit | 9afed40ea684127056bcd5019533522aa67cbb57 (patch) | |
tree | b6b71fb945e0e6d4a9bedaaf29afbda494141ee5 | |
parent | 07f82ad1be4fc8c7722e07241492c68abab8ff92 (diff) | |
download | rneovim-9afed40ea684127056bcd5019533522aa67cbb57.tar.gz rneovim-9afed40ea684127056bcd5019533522aa67cbb57.tar.bz2 rneovim-9afed40ea684127056bcd5019533522aa67cbb57.zip |
man.vim: fix for mandoc (#8698)
When giving a section, the first candidate selection was not performed.
followup/fixup #8341
-rw-r--r-- | runtime/autoload/man.vim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim index f21e2ee4f3..77ccbdf888 100644 --- a/runtime/autoload/man.vim +++ b/runtime/autoload/man.vim @@ -212,9 +212,9 @@ function! man#extract_sect_and_name_ref(ref) abort endfunction function! s:get_path(sect, name) abort + " Some man implementations (OpenBSD) return all available paths from the + " search command, so we get() the first one. #8341 if empty(a:sect) - " Some man implementations (OpenBSD) return all available paths from the - " search command, so we get() the first one. #8341 return substitute(get(split(s:system(['man', s:find_arg, a:name])), 0, ''), '\n\+$', '', '') endif " '-s' flag handles: @@ -222,7 +222,7 @@ function! s:get_path(sect, name) abort " - sections starting with '-' " - 3pcap section (found on macOS) " - commas between sections (for section priority) - return substitute(s:system(['man', s:find_arg, s:section_arg, a:sect, a:name]), '\n\+$', '', '') + return substitute(get(split(s:system(['man', s:find_arg, s:section_arg, a:sect, a:name])), 0, ''), '\n\+$', '', '') endfunction function! s:verify_exists(sect, name) abort |