neovim: Update to latest git (fixes #2092)
[termux-packages] / packages / neovim / runtime-autoload-man.vim.patch
index 597a277..d5a6c6e 100644 (file)
@@ -1,30 +1,23 @@
-diff -u -r ../neovim-7307096c5ef5f54e49f2f49fb049fe40f8417f7e/runtime/autoload/man.vim ./runtime/autoload/man.vim
---- ../neovim-7307096c5ef5f54e49f2f49fb049fe40f8417f7e/runtime/autoload/man.vim        2016-09-22 08:11:13.000000000 -0400
-+++ ./runtime/autoload/man.vim 2016-09-24 14:41:35.806285095 -0400
-@@ -79,7 +79,7 @@
+diff -u -r ../neovim-0851057a8deaa1197bd0af22babb62c1146d836c/runtime/autoload/man.vim ./runtime/autoload/man.vim
+--- ../neovim-0851057a8deaa1197bd0af22babb62c1146d836c/runtime/autoload/man.vim        2018-02-04 12:54:30.000000000 +0000
++++ ./runtime/autoload/man.vim 2018-02-05 00:48:37.422608665 +0000
+@@ -149,7 +149,7 @@
+   " Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db).
    " http://comments.gmane.org/gmane.editors.vim.devel/29085
-   " Respect $MANWIDTH, or default to window width.
-   let cmd  = 'env MANPAGER=cat'.(empty($MANWIDTH) ? ' MANWIDTH='.winwidth(0) : '')
--  let cmd .= ' '.s:man_cmd.' '.shellescape(a:path)
-+  let cmd .= ' '.s:man_cmd.' -l '.shellescape(a:path).'| uniq'
-   silent put =system(cmd)
-   " remove all the backspaced text
-   execute 'silent keeppatterns keepjumps %substitute,.\b,,e'.(&gdefault?'':'g')
-@@ -112,7 +112,7 @@
+   " Set MAN_KEEP_FORMATTING so Debian man doesn't discard backspaces.
+-  let cmd = ['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'MAN_KEEP_FORMATTING=1', 'man']
++  let cmd = ['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'MAN_KEEP_FORMATTING=1', 'mandoc']
+   return s:system(cmd + (s:localfile_arg ? ['-l', a:path] : [a:path]))
+ endfunction
+@@ -213,7 +213,9 @@
  
  function! s:get_path(sect, name) abort
    if empty(a:sect)
--    let path = system(s:man_cmd.' '.s:man_find_arg.' '.shellescape(a:name))
-+    let path = system(s:man_cmd.' '.s:man_find_arg.' '.shellescape(a:name).'| head -n 1')
-     if path !~# '^\/'
-       throw 'no manual entry for '.a:name
-     endif
-@@ -123,7 +123,7 @@
-   "   - sections starting with '-'
-   "   - 3pcap section (found on macOS)
-   "   - commas between sections (for section priority)
--  return system(s:man_cmd.' '.s:man_find_arg.' -s '.shellescape(a:sect).' '.shellescape(a:name))
-+  return system(s:man_cmd.' '.s:man_find_arg.' -s '.shellescape(a:sect).' '.shellescape(a:name).'| head -n 1')
- endfunction
- function! s:verify_exists(sect, name) abort
+-    return s:system(['man', s:find_arg, a:name])
++    " Take the first one if multiple lines returned, such as when
++    " both man1p/test.1p and man1/test.1 exists.
++    return split(s:system(['man', s:find_arg, a:name]), "\n")[0] . "\n"
+   endif
+   " '-s' flag handles:
+   "   - tokens like 'printf(echo)'