The man.vim script assumes that foldcolumn and numberwidth are 0. If they are not, the generated lines are too long.
Here's a patch to fix this:

~$ diff -u /usr/share/vim/vim70/ftplugin/man.vim /home/guivho/.vim/ftplugin/man.vim --- /usr/share/vim/vim70/ftplugin/man.vim 2006-10-20 11:48:47.000000000 +0200
+++ /home/guivho/.vim/ftplugin/man.vim  2006-12-03 09:15:37.000000000 +0100
@@ -141,7 +141,13 @@

   setl ma
   silent exec "norm 1GdG"
-  let $MANWIDTH = winwidth(0)
+  " leave room for foldcolumn and numberwidth
+  let s:notfree = &numberwidth + &foldcolumn
+  if &foldcolumn == 4
+    " one extra col allows for man pages > 999 lines, e.g. bash
+    let s:notfree = s:notfree + 1
+  endif
+  let $MANWIDTH = winwidth(0) - s:notfree
   silent exec "r!/usr/bin/man ".s:GetCmdArg(sect, page)." | col -b"
   " Remove blank lines from top and bottom.
   while getline(1) =~ '^\s*$'
~$

Guido

Reply via email to