man.vim: set $MANWIDTH=999

On some systems, mandoc disallows $MANWIDTH greater than 1000.
E.g. FreeBSD:
b7d613ae8a/contrib/mandoc/manpath.c (L312)

closes #9065
This commit is contained in:
Justin M. Keyes 2018-09-30 18:35:19 +02:00
parent 6c496db4b7
commit 3999aa755e

View File

@ -149,9 +149,9 @@ function! s:system(cmd, ...) abort
endfunction
function! s:get_page(path) abort
" Disable hard-wrap by setting $MANWIDTH to a high value.
" Use soft wrap instead (ftplugin/man.vim sets 'wrap', 'breakindent').
let manwidth = 9999
" Disable hard-wrap by using a big $MANWIDTH (max 1000 on some systems #9065).
" We use soft wrap: ftplugin/man.vim sets wrap/breakindent/….
let manwidth = 999
" Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db).
" http://comments.gmane.org/gmane.editors.vim.devel/29085
" Set MAN_KEEP_FORMATTING so Debian man doesn't discard backspaces.
@ -168,9 +168,9 @@ function! s:put_page(page) abort
silent keepjumps 1delete _
endwhile
" XXX: nroff justifies text by filling it with whitespace. That interacts
" badly with our use of $MANWIDTH=9999. Hack around this by using a fixed
" badly with our use of $MANWIDTH=999. Hack around this by using a fixed
" size for those whitespace regions.
silent! keeppatterns keepjumps %s/\s\{999,}/\=repeat(' ', 10)/g
silent! keeppatterns keepjumps %s/\s\{199,}/\=repeat(' ', 10)/g
1
lua require("man").highlight_man_page()
setlocal filetype=man