mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
man.vim: Fix very long justified lines #9023
When nroff justifies a line, it fills the line with whitespace to meet $MANWIDTH. With $MANWIDTH=9999, that of course results in nonsense (and behaves poorly with 'cursorline' option). To work around that, instead of trying to hard-justify the lines, just replace the mega-whitespace with a fixed size of 10 spaces. Perhaps N/Vim needs a "soft justify" feature?
This commit is contained in:
parent
9081cad514
commit
dc256e376d
@ -167,6 +167,10 @@ function! s:put_page(page) abort
|
||||
while getline(1) =~# '^\s*$'
|
||||
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
|
||||
" size for those whitespace regions.
|
||||
silent! keeppatterns keepjumps %s/\s\{999,}/\=repeat(' ', 10)/g
|
||||
lua require("man").highlight_man_page()
|
||||
setlocal filetype=man
|
||||
endfunction
|
||||
|
Loading…
Reference in New Issue
Block a user