mirror of
https://github.com/neovim/neovim.git
synced 2024-12-31 17:13:26 -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
|
endfunction
|
||||||
|
|
||||||
function! s:get_path(sect, name) abort
|
function! s:get_path(sect, name) abort
|
||||||
if empty(a:sect)
|
|
||||||
" Some man implementations (OpenBSD) return all available paths from the
|
" Some man implementations (OpenBSD) return all available paths from the
|
||||||
" search command, so we get() the first one. #8341
|
" search command, so we get() the first one. #8341
|
||||||
|
if empty(a:sect)
|
||||||
return substitute(get(split(s:system(['man', s:find_arg, a:name])), 0, ''), '\n\+$', '', '')
|
return substitute(get(split(s:system(['man', s:find_arg, a:name])), 0, ''), '\n\+$', '', '')
|
||||||
endif
|
endif
|
||||||
" '-s' flag handles:
|
" '-s' flag handles:
|
||||||
@ -222,7 +222,7 @@ function! s:get_path(sect, name) abort
|
|||||||
" - sections starting with '-'
|
" - sections starting with '-'
|
||||||
" - 3pcap section (found on macOS)
|
" - 3pcap section (found on macOS)
|
||||||
" - commas between sections (for section priority)
|
" - 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
|
endfunction
|
||||||
|
|
||||||
function! s:verify_exists(sect, name) abort
|
function! s:verify_exists(sect, name) abort
|
||||||
|
Loading…
Reference in New Issue
Block a user