| 1 | diff -u -r ../neovim-1b2acb8d958c1c8e2f382c2de9c98586801fd9fe/runtime/autoload/man.vim ./runtime/autoload/man.vim |
| 2 | --- ../neovim-1b2acb8d958c1c8e2f382c2de9c98586801fd9fe/runtime/autoload/man.vim 2017-06-03 21:00:05.000000000 +0200 |
| 3 | +++ ./runtime/autoload/man.vim 2017-06-05 01:15:56.254306768 +0200 |
| 4 | @@ -148,7 +148,7 @@ |
| 5 | let manwidth = empty($MANWIDTH) ? winwidth(0) : $MANWIDTH |
| 6 | " Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db). |
| 7 | " http://comments.gmane.org/gmane.editors.vim.devel/29085 |
| 8 | - let cmd = ['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'man'] |
| 9 | + let cmd = ['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'mandoc'] |
| 10 | return s:system(cmd + (s:localfile_arg ? ['-l', a:path] : [a:path])) |
| 11 | endfunction |
| 12 | |
| 13 | @@ -213,7 +213,9 @@ |
| 14 | |
| 15 | function! s:get_path(sect, name) abort |
| 16 | if empty(a:sect) |
| 17 | - return s:system(['man', s:find_arg, a:name]) |
| 18 | + " Take the first one if multiple lines returned, such as when |
| 19 | + " both man1p/test.1p and man1/test.1 exists. |
| 20 | + return split(s:system(['man', s:find_arg, a:name]), "\n")[0] . "\n" |
| 21 | endif |
| 22 | " '-s' flag handles: |
| 23 | " - tokens like 'printf(echo)' |