Currently, man.vim lets $MANWIDTH, if it is empty, to the width of the window at that time. If :Man is later called in a different sized window, the results will look wrong.
The attached patch lets $MANWIDTH to an empty value after running man, if it was empty to start with. This restores the state of $MANWIDTH, so the width will be updated the next time :Man is used. Cheers, -- James GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7 2D23 DFE6 91AE 331B A3DB
diff --git i/runtime/ftplugin/man.vim w/runtime/ftplugin/man.vim index 43f343a..3698a39 100644 --- i/runtime/ftplugin/man.vim +++ w/runtime/ftplugin/man.vim @@ -160,10 +160,15 @@ func <SID>GetPage(...) setl ma nonu nornu nofen silent exec "norm 1GdG" + let unsetwidth = 0 if empty($MANWIDTH) let $MANWIDTH = winwidth(0) + let unsetwidth = 1 endif silent exec "r!/usr/bin/man ".s:GetCmdArg(sect, page)." | col -b" + if unsetwidth + let $MANWIDTH = '' + endif " Remove blank lines from top and bottom. while getline(1) =~ '^\s*$' silent keepj norm ggdd