From 52b7d2674f5d387c9318d444ba8dcf24f6f7575e Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Wed, 7 May 2008 05:04:07 -0500 Subject: handle terminal widths other than 80 --- vim/plugin/foldtext.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vim/plugin/foldtext.vim') 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 {{{ -- cgit v1.2.3-54-g00ecf