From 25d428c3900d8f45d2b3f771a734033fb0104262 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Fri, 12 Apr 2013 13:17:05 +0200 Subject: [PATCH] Use correct filename in auto commands. This problem was revealed when using BufExplorer: - Open vim with two files: `$ vim a.txt b.txt` - Type `\\` to open BufExplorer. - Press on `b.txt`. - Vim shows `b.txt` as expected. - Type `\\` to open BufExplorer. - Press on `a.txt`. - Expected: Vim shows `a.txt`. Actual Vim shows `a.txt`, `b.txt`, `a.txt`. I.e. the first invocation was fine but all subsequent invocations rapidly flicked through , , . --- plugin/gitgutter.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/gitgutter.vim b/plugin/gitgutter.vim index 90f97f0..47d9cd8 100644 --- a/plugin/gitgutter.vim +++ b/plugin/gitgutter.vim @@ -533,9 +533,9 @@ endfunction augroup gitgutter autocmd! if g:gitgutter_on_bufenter - autocmd BufEnter,BufWritePost,FileWritePost * call GitGutter(s:current_file()) + autocmd BufEnter,BufWritePost,FileWritePost * call GitGutter(expand('')) else - autocmd BufReadPost,BufWritePost,FileReadPost,FileWritePost * call GitGutter(s:current_file()) + autocmd BufReadPost,BufWritePost,FileReadPost,FileWritePost * call GitGutter(expand('')) endif if g:gitgutter_all_on_focusgained if !has('gui_win32')