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
|
endfor
|
||||||
|
|
||||||
let b:fugitive_reltime = reltime()
|
let b:fugitive_reltime = reltime()
|
||||||
return ''
|
return 'silent ' . s:DoAutocmd('User FugitiveIndex')
|
||||||
catch /^fugitive:/
|
catch /^fugitive:/
|
||||||
return 'echoerr ' . string(v:exception)
|
return 'echoerr ' . string(v:exception)
|
||||||
endtry
|
endtry
|
||||||
@@ -2010,7 +2010,7 @@ function! fugitive#BufReadCmd(...) abort
|
|||||||
setlocal endofline
|
setlocal endofline
|
||||||
|
|
||||||
try
|
try
|
||||||
silent doautocmd BufReadPre
|
silent exe s:DoAutocmd('BufReadPre')
|
||||||
if b:fugitive_type ==# 'tree'
|
if b:fugitive_type ==# 'tree'
|
||||||
let b:fugitive_display_format = b:fugitive_display_format % 2
|
let b:fugitive_display_format = b:fugitive_display_format % 2
|
||||||
if b:fugitive_display_format
|
if b:fugitive_display_format
|
||||||
@@ -2078,7 +2078,8 @@ function! fugitive#BufReadCmd(...) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
return 'silent ' . s:DoAutocmd('BufReadPost') .
|
return 'silent ' . s:DoAutocmd('BufReadPost') .
|
||||||
\ (modifiable ? '' : '|setl nomodifiable')
|
\ (modifiable ? '' : '|setl nomodifiable') . '|silent ' .
|
||||||
|
\ s:DoAutocmd('User Fugitive' . substitute(b:fugitive_type, '^\l', '\u&', ''))
|
||||||
catch /^fugitive:/
|
catch /^fugitive:/
|
||||||
return 'echoerr ' . string(v:exception)
|
return 'echoerr ' . string(v:exception)
|
||||||
endtry
|
endtry
|
||||||
|
|||||||
Reference in New Issue
Block a user