mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-17 07:43:44 -05:00
Support folding sections
Resolves: https://github.com/tpope/vim-fugitive/issues/2111 References: https://github.com/tpope/vim-fugitive/issues/1317
This commit is contained in:
@@ -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"')
|
||||
|
||||
Reference in New Issue
Block a user