Disable modelines while loading blob
Modelines will still be evaluated by `doautocmd BufReadPost`. References https://github.com/tpope/vim-fugitive/issues/1136
This commit is contained in:
parent
70170d825c
commit
38c6acf27a
@ -1347,13 +1347,16 @@ function! s:ReplaceCmd(cmd, ...) abort
|
||||
let fn = expand('%:p')
|
||||
silent exe 'doau BufReadPre '.s:fnameescape(fn)
|
||||
silent exe 'keepalt file '.temp
|
||||
let modelines = &modelines
|
||||
try
|
||||
set modelines=0
|
||||
if a:0
|
||||
silent noautocmd edit!
|
||||
else
|
||||
silent edit!
|
||||
endif
|
||||
finally
|
||||
let &modelines = modelines
|
||||
try
|
||||
silent exe 'keepalt file '.s:fnameescape(fn)
|
||||
catch /^Vim\%((\a\+)\)\=:E302:/
|
||||
|
Loading…
Reference in New Issue
Block a user