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