From 0b43b51d7785aeb4002b45ca49cea5aef0d2e988 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 3 Dec 2014 00:35:18 +0100 Subject: [PATCH] Expand `%` instead of `` 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. --- plugin/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index cd7e560..60e27c4 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -220,7 +220,7 @@ endfunction augroup fugitive autocmd! - autocmd BufNewFile,BufReadPost * call fugitive#detect(expand(':p')) + autocmd BufNewFile,BufReadPost * 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 VimEnter * if expand('')==''|call fugitive#detect(getcwd())|endif