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.
This commit is contained in:
Tim Pope
2021-05-12 14:08:08 -04:00
parent 7a75c18554
commit 47a07a0a32

View File

@@ -2261,8 +2261,8 @@ function! fugitive#BufReadCmd(...) abort
setlocal endofline setlocal endofline
try try
if &foldmethod ==# 'marker' && b:fugitive_type !=# 'blob' if b:fugitive_type !=# 'blob'
setlocal foldmethod=manual setlocal foldmarker=<<<<<<<<,>>>>>>>>
endif endif
silent exe s:DoAutocmd('BufReadPre') silent exe s:DoAutocmd('BufReadPre')
if b:fugitive_type ==# 'tree' if b:fugitive_type ==# 'tree'
@@ -2405,7 +2405,7 @@ function! s:TempReadPost(file) abort
if has_key(dict, 'filetype') if has_key(dict, 'filetype')
let &l:filetype = dict.filetype let &l:filetype = dict.filetype
endif endif
setlocal foldmarker=<<<<<<<,>>>>>>> setlocal foldmarker=<<<<<<<<,>>>>>>>>
if !&modifiable if !&modifiable
if empty(mapcheck('q', 'n')) if empty(mapcheck('q', 'n'))
nnoremap <buffer> <silent> q :<C-U>echoerr "fugitive: q is removed in favor of gq (or :q)"<CR> nnoremap <buffer> <silent> q :<C-U>echoerr "fugitive: q is removed in favor of gq (or :q)"<CR>
@@ -3101,7 +3101,7 @@ function! s:StatusCommand(line1, line2, range, count, bang, mods, reg, arg, args
try try
let mods = s:Mods(a:mods, &splitbelow ? 'botright' : 'topleft') let mods = s:Mods(a:mods, &splitbelow ? 'botright' : 'topleft')
let file = fugitive#Find(':', dir) let file = fugitive#Find(':', dir)
let arg = ' +let\ w:fugitive_status=FugitiveGitDir() ' . let arg = ' +setl\ foldmarker=<<<<<<<<,>>>>>>>>\|let\ w:fugitive_status=FugitiveGitDir() ' .
\ s:fnameescape(file) \ s:fnameescape(file)
for tabnr in [tabpagenr()] + (mods =~# '\<tab\>' ? range(1, tabpagenr('$')) : []) for tabnr in [tabpagenr()] + (mods =~# '\<tab\>' ? range(1, tabpagenr('$')) : [])
let bufs = tabpagebuflist(tabnr) let bufs = tabpagebuflist(tabnr)