commit 156dbcd738fbf997bfc996760d1f979a4496c746 (tree)
parent 133bf406c7e1d44abe3f48951c4867cefca2bdd1
Author: Tim Pope <code@tpope.net>
Date: Tue, 23 Mar 2021 19:35:47 -0400
Don't set foldmethod=syntax in historical buffers
This was originally implemented in part to address the marker fold
method triggering on diffs, so try to still solve that.
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
@@ -2180,6 +2180,9 @@ function! fugitive#BufReadCmd(...) abort
setlocal endofline
try
+ if &foldmethod ==# 'marker' && b:fugitive_type !=# 'blob'
+ setlocal foldmethod=manual
+ endif
silent exe s:DoAutocmd('BufReadPre')
if b:fugitive_type ==# 'tree'
let b:fugitive_display_format = b:fugitive_display_format % 2
@@ -2233,7 +2236,7 @@ function! fugitive#BufReadCmd(...) abort
endif
let &l:modifiable = modifiable
if b:fugitive_type !=# 'blob'
- setlocal filetype=git foldmethod=syntax
+ setlocal filetype=git
call s:Map('n', 'a', ":<C-U>let b:fugitive_display_format += v:count1<Bar>exe fugitive#BufReadCmd(@%)<CR>", '<silent>')
call s:Map('n', 'i', ":<C-U>let b:fugitive_display_format -= v:count1<Bar>exe fugitive#BufReadCmd(@%)<CR>", '<silent>')
endif