diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index ce16048..ea9820b 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -8124,6 +8124,9 @@ function! fugitive#Foldtext() abort endif elseif line_foldstart =~# '^@@\+ .* @@' return '+-' . v:folddashes . ' ' . line_foldstart + elseif &filetype ==# 'fugitive' && line_foldstart =~# '^[A-Z][a-z].* (\d\+)$' + let c = +matchstr(line_foldstart, '(\zs\d\+\ze)$') + return '+-' . v:folddashes . printf('%3d item', c) . (c == 1 ? ': ' : 's: ') . matchstr(line_foldstart, '.*\ze (\d\+)$') elseif &filetype ==# 'gitcommit' && line_foldstart =~# '^# .*:$' let lines = getline(v:foldstart, v:foldend) call filter(lines, 'v:val =~# "^#\t"') diff --git a/syntax/fugitive.vim b/syntax/fugitive.vim index e61b34f..c7fe201 100644 --- a/syntax/fugitive.vim +++ b/syntax/fugitive.vim @@ -13,7 +13,7 @@ syn match fugitiveHeader /^Pull:\|^Rebase:\|^Merge:\|^Push:/ nextgroup=fugitiveS syn match fugitiveHelpHeader /^Help:/ nextgroup=fugitiveHelpTag skipwhite syn match fugitiveHelpTag /\S\+/ contained -syn region fugitiveSection start=/^\%(.*(\d\++\=)$\)\@=/ contains=fugitiveHeading end=/^$/ +syn region fugitiveSection start=/^\%(.*(\d\++\=)$\)\@=/ contains=fugitiveHeading end=/^$/ fold syn cluster fugitiveSection contains=fugitiveSection syn match fugitiveHeading /^[A-Z][a-z][^:]*\ze (\d\++\=)$/ contains=fugitivePreposition contained nextgroup=fugitiveCount skipwhite syn match fugitiveCount /(\d\++\=)/hs=s+1,he=e-1 contained @@ -30,7 +30,7 @@ syn match fugitiveHash /\S\@