mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-12 05:13:53 -05:00
Provide FugitiveBlob style autocommands
This is the real replacement for fugitive#buffer().type(), as the only real world use of that seemed to be in BufReadPost autocommands.
This commit is contained in:
@@ -1907,7 +1907,7 @@ function! fugitive#BufReadStatus() abort
|
||||
endfor
|
||||
|
||||
let b:fugitive_reltime = reltime()
|
||||
return ''
|
||||
return 'silent ' . s:DoAutocmd('User FugitiveIndex')
|
||||
catch /^fugitive:/
|
||||
return 'echoerr ' . string(v:exception)
|
||||
endtry
|
||||
@@ -2010,7 +2010,7 @@ function! fugitive#BufReadCmd(...) abort
|
||||
setlocal endofline
|
||||
|
||||
try
|
||||
silent doautocmd BufReadPre
|
||||
silent exe s:DoAutocmd('BufReadPre')
|
||||
if b:fugitive_type ==# 'tree'
|
||||
let b:fugitive_display_format = b:fugitive_display_format % 2
|
||||
if b:fugitive_display_format
|
||||
@@ -2078,7 +2078,8 @@ function! fugitive#BufReadCmd(...) abort
|
||||
endif
|
||||
|
||||
return 'silent ' . s:DoAutocmd('BufReadPost') .
|
||||
\ (modifiable ? '' : '|setl nomodifiable')
|
||||
\ (modifiable ? '' : '|setl nomodifiable') . '|silent ' .
|
||||
\ s:DoAutocmd('User Fugitive' . substitute(b:fugitive_type, '^\l', '\u&', ''))
|
||||
catch /^fugitive:/
|
||||
return 'echoerr ' . string(v:exception)
|
||||
endtry
|
||||
|
||||
Reference in New Issue
Block a user