mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-09 20:13:46 -05:00
Fix modeline support in historical buffers
Closes https://github.com/tpope/vim-fugitive/issues/1092
This commit is contained in:
@@ -1267,7 +1267,7 @@ endfunction
|
|||||||
|
|
||||||
" Section: Buffer auto-commands
|
" Section: Buffer auto-commands
|
||||||
|
|
||||||
function! s:ReplaceCmd(cmd) abort
|
function! s:ReplaceCmd(cmd, ...) abort
|
||||||
let temp = tempname()
|
let temp = tempname()
|
||||||
let err = s:TempCmd(temp, a:cmd)
|
let err = s:TempCmd(temp, a:cmd)
|
||||||
if v:shell_error
|
if v:shell_error
|
||||||
@@ -1278,7 +1278,11 @@ function! s:ReplaceCmd(cmd) abort
|
|||||||
silent exe 'doau BufReadPre '.s:fnameescape(fn)
|
silent exe 'doau BufReadPre '.s:fnameescape(fn)
|
||||||
silent exe 'keepalt file '.temp
|
silent exe 'keepalt file '.temp
|
||||||
try
|
try
|
||||||
silent noautocmd edit!
|
if a:0
|
||||||
|
silent noautocmd edit!
|
||||||
|
else
|
||||||
|
silent edit!
|
||||||
|
endif
|
||||||
finally
|
finally
|
||||||
try
|
try
|
||||||
silent exe 'keepalt file '.s:fnameescape(fn)
|
silent exe 'keepalt file '.s:fnameescape(fn)
|
||||||
@@ -1314,7 +1318,7 @@ function! fugitive#BufReadStatus() abort
|
|||||||
\ '-c', 'status.short=false',
|
\ '-c', 'status.short=false',
|
||||||
\ 'status']
|
\ 'status']
|
||||||
endif
|
endif
|
||||||
call s:ReplaceCmd(call('fugitive#Prepare', cmd))
|
call s:ReplaceCmd(call('fugitive#Prepare', cmd), 1)
|
||||||
if b:fugitive_display_format
|
if b:fugitive_display_format
|
||||||
if &filetype !=# 'git'
|
if &filetype !=# 'git'
|
||||||
set filetype=git
|
set filetype=git
|
||||||
|
|||||||
Reference in New Issue
Block a user