From 47a07a0a32d8db5a254a2e8c790bfd98f681b13c Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 12 May 2021 14:08:08 -0400 Subject: [PATCH] Standardize method for disabling foldmethod=marker The foldmarker option does appear to be buffer local (despite being documented as window local), so it should be safe to use this everywhere. --- autoload/fugitive.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index e8319b8..23b0dc9 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2261,8 +2261,8 @@ function! fugitive#BufReadCmd(...) abort setlocal endofline try - if &foldmethod ==# 'marker' && b:fugitive_type !=# 'blob' - setlocal foldmethod=manual + if b:fugitive_type !=# 'blob' + setlocal foldmarker=<<<<<<<<,>>>>>>>> endif silent exe s:DoAutocmd('BufReadPre') if b:fugitive_type ==# 'tree' @@ -2405,7 +2405,7 @@ function! s:TempReadPost(file) abort if has_key(dict, 'filetype') let &l:filetype = dict.filetype endif - setlocal foldmarker=<<<<<<<,>>>>>>> + setlocal foldmarker=<<<<<<<<,>>>>>>>> if !&modifiable if empty(mapcheck('q', 'n')) nnoremap q :echoerr "fugitive: q is removed in favor of gq (or :q)" @@ -3101,7 +3101,7 @@ function! s:StatusCommand(line1, line2, range, count, bang, mods, reg, arg, args try let mods = s:Mods(a:mods, &splitbelow ? 'botright' : 'topleft') let file = fugitive#Find(':', dir) - let arg = ' +let\ w:fugitive_status=FugitiveGitDir() ' . + let arg = ' +setl\ foldmarker=<<<<<<<<,>>>>>>>>\|let\ w:fugitive_status=FugitiveGitDir() ' . \ s:fnameescape(file) for tabnr in [tabpagenr()] + (mods =~# '\' ? range(1, tabpagenr('$')) : []) let bufs = tabpagebuflist(tabnr)