diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 11f46a2..15b5b33 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1718,16 +1718,17 @@ function! fugitive#BufReadCmd(...) abort if &bufhidden ==# '' setlocal bufhidden=delete endif + let &modifiable = modifiable if b:fugitive_type !=# 'blob' setlocal filetype=git foldmethod=syntax nnoremap a :let b:fugitive_display_format += v:count1exe fugitive#BufReadCmd(@%) nnoremap i :let b:fugitive_display_format -= v:count1exe fugitive#BufReadCmd(@%) else - let &modifiable = modifiable call fugitive#MapJumps() endif endtry + setlocal modifiable return 'silent doautocmd' . (v:version >= 704 ? ' ' : '') . \ ' BufReadPost' . (modifiable ? '' : '|setl nomodifiable') catch /^fugitive:/