Skip to content

Commit

Permalink
allow to customize max width of folded text
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbra committed Dec 7, 2014
1 parent 4fba4ac commit a1a1060
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugin/CustomFoldText.vim
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ fu! CustomFoldText(string) "{{{1
" let line = substitute(line, matchstr(&l:cms,
" \ '^.\{-}\ze%s').'\?\s*'. split(&l:fmr,',')[0].'\s*\d\+', '', '')

let w = winwidth(0) - &foldcolumn - (&number ? 8 : 0)
if get(g:, 'custom_foldtext_max_width', 0)
let w = g:custom_foldtext_max_width - &foldcolumn - (&number ? 8 : 0)
else
let w = winwidth(0) - &foldcolumn - (&number ? 8 : 0)
endif
let foldSize = 1 + v:foldend - v:foldstart
let foldSizeStr = " " . foldSize . " lines "
let foldLevelStr = '+'. v:folddashes
Expand Down

0 comments on commit a1a1060

Please sign in to comment.