mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
man.vim: fix for mandoc (#8698)
When giving a section, the first candidate selection was not performed. followup/fixup #8341
This commit is contained in:
parent
07f82ad1be
commit
9afed40ea6
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user