Permalink
Browse files

man.vim: fix for mandoc (#8698)

When giving a section, the first candidate selection was not performed.

followup/fixup #8341
  • Loading branch information...
bb010g authored and justinmk committed Jul 8, 2018
1 parent 07f82ad commit 9afed40ea684127056bcd5019533522aa67cbb57
Showing with 3 additions and 3 deletions.
  1. +3 −3 runtime/autoload/man.vim
@@ -212,17 +212,17 @@ 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:
" - tokens like 'printf(echo)'
" - 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

0 comments on commit 9afed40

Please sign in to comment.