man.vim: s:get_path(): trim newline in all cases

ref #8372
This commit is contained in:
Justin M. Keyes 2018-05-10 16:03:13 +02:00
parent 3a6b80f2f4
commit 1cd8517344

View File

@ -215,7 +215,7 @@ function! s:get_path(sect, name) abort
if empty(a:sect) 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
return get(split(s:system(['man', s:find_arg, a:name])), 0, '') return substitute(get(split(s:system(['man', s:find_arg, a:name])), 0, ''), '\n\+$', '', '')
endif endif
" '-s' flag handles: " '-s' flag handles:
" - tokens like 'printf(echo)' " - tokens like 'printf(echo)'