mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
6c496db4b7
commit
3999aa755e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user