foldtext updated

This commit is contained in:
ManjaroOne666 2018-05-03 14:44:13 +01:00
parent ff11c7de9c
commit 9ffad74f59
1 changed files with 7 additions and 1 deletions

View File

@ -67,7 +67,13 @@ set foldtext=MyFoldText()
function! MyFoldText()
let l:linecount = v:foldend - v:foldstart - 1
let l:line = getline(v:foldstart)
return v:folddashes . ' ' . l:line . ' |+' . l:linecount . '|'
let l:prefix = '|+' . l:linecount . v:folddashes . '| '
let l:subexp = '^ \{,' . len(l:prefix) . '}'
let l:foldtext = substitute(l:line, l:subexp, l:prefix, '')
return l:foldtext
endfunction