diff options
author | Marcus Fritzsch <fritschy@users.noreply.github.com> | 2017-01-06 00:20:22 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-01-06 00:20:22 +0100 |
commit | afa7f42f77f209d89fa3c84e5f627fbd2e536c4d (patch) | |
tree | b3b947d57a057f5d95999c30cc8528d1d4c358c3 | |
parent | 1fbee630a8f2db83359e225802ee1bc9eef55e65 (diff) | |
download | rneovim-afa7f42f77f209d89fa3c84e5f627fbd2e536c4d.tar.gz rneovim-afa7f42f77f209d89fa3c84e5f627fbd2e536c4d.tar.bz2 rneovim-afa7f42f77f209d89fa3c84e5f627fbd2e536c4d.zip |
man.vim: Avoid empty argument when MANWIDTH is set. (#5882)
-rw-r--r-- | runtime/autoload/man.vim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim index 6fed4a54e3..251e6eee41 100644 --- a/runtime/autoload/man.vim +++ b/runtime/autoload/man.vim @@ -113,10 +113,11 @@ function! s:system(cmd, ...) abort endfunction function! s:get_page(path) abort + " Respect $MANWIDTH or default to window width. + let manwidth = empty($MANWIDTH) ? winwidth(0) : $MANWIDTH " 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. - return s:system(['env', 'MANPAGER=cat', (empty($MANWIDTH) ? 'MANWIDTH='.winwidth(0) : ''), 'man', a:path]) + return s:system(['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'man', a:path]) endfunction function! s:put_page(page) abort |