diff --git a/vimrc.functions.vim b/vimrc.functions.vim index e82975d..6bb6c88 100644 --- a/vimrc.functions.vim +++ b/vimrc.functions.vim @@ -94,15 +94,22 @@ function! MyFoldText() let l:linecount = v:foldend - v:foldstart - 1 let l:line = getline(v:foldstart) - let l:postfix = ' +' . l:linecount . ' ' . v:folddashes . '|' + let l:postfix = ' +' . l:linecount . ' ' . v:folddashes . '|' + while len(l:postfix) < 11 + let l:postfix = ' ' . l:postfix + endwhile " unicode characters counted as 2 digits in length - TODO find fix + " checkout strlen " let l:postfix = ' •••••••••••• +' . l:linecount . ' ' . v:folddashes . '|' let l:len_line = len(l:line) let l:len_postfix = len(l:postfix) if l:len_line + l:len_postfix <= 80 - let l:padding = ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'[0:79 - l:len_line - l:len_postfix] + let l:padding = ' ' . ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'[l:len_line + l:len_postfix + 4:79] + if l:padding[:-1] !== '-' + let l:padding = ' ' . l:padding [0:-1] + endif let l:foldtext = l:line . l:padding . l:postfix else let l:foldtext = l:line[:76 - l:len_postfix] . '...' . l:postfix