summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-05-07 05:04:07 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-05-07 05:04:07 -0500
commit52b7d2674f5d387c9318d444ba8dcf24f6f7575e (patch)
tree83e75145e9ff45e842d42f539c22b60caeba776a
parentdfdbc19ddc951a93c8c24a9eb87b03a8600d00cb (diff)
downloadvim-foldtext-52b7d2674f5d387c9318d444ba8dcf24f6f7575e.tar.gz
vim-foldtext-52b7d2674f5d387c9318d444ba8dcf24f6f7575e.zip
handle terminal widths other than 80
-rw-r--r--vim/plugin/foldtext.vim4
1 files changed, 2 insertions, 2 deletions
diff --git a/vim/plugin/foldtext.vim b/vim/plugin/foldtext.vim
index 728b822..a8f31b7 100644
--- a/vim/plugin/foldtext.vim
+++ b/vim/plugin/foldtext.vim
@@ -34,8 +34,8 @@ function Foldtext_base(...)
let line = substitute(line, '^\s*\(.\{-}\)\s*$', '\1', '')
" }}}
" align everything, and pad the end of the display with - {{{
- let line = printf('%-' . (62 - v:foldlevel) . 's', line)
- let line = strpart(line, 0, 62 - v:foldlevel)
+ let alignment = &columns - 18 - v:foldlevel
+ let line = strpart(printf('%-' . alignment . 's', line), 0, alignment)
let line = substitute(line, '\%( \)\@<= \%( *$\)\@=', '-', 'g')
" }}}
" format the line count {{{