mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 19:43:46 -05:00
Expand % instead of <amatch> in the Buf* autocommands
This is relevant in case a previous BufReadPost autocmd changes the file name using `:file` - fugitive should use the new/current name then.
This commit is contained in:
@@ -220,7 +220,7 @@ endfunction
|
|||||||
|
|
||||||
augroup fugitive
|
augroup fugitive
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufNewFile,BufReadPost * call fugitive#detect(expand('<amatch>:p'))
|
autocmd BufNewFile,BufReadPost * call fugitive#detect(expand('%:p'))
|
||||||
autocmd FileType netrw call fugitive#detect(expand('%:p'))
|
autocmd FileType netrw call fugitive#detect(expand('%:p'))
|
||||||
autocmd User NERDTreeInit,NERDTreeNewRoot call fugitive#detect(b:NERDTreeRoot.path.str())
|
autocmd User NERDTreeInit,NERDTreeNewRoot call fugitive#detect(b:NERDTreeRoot.path.str())
|
||||||
autocmd VimEnter * if expand('<amatch>')==''|call fugitive#detect(getcwd())|endif
|
autocmd VimEnter * if expand('<amatch>')==''|call fugitive#detect(getcwd())|endif
|
||||||
|
|||||||
Reference in New Issue
Block a user