mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 19:43:47 -05:00
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 <enter> on `b.txt`. - Vim shows `b.txt` as expected. - Type `\\` to open BufExplorer. - Press <enter> 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 <new file>, <old file>, <new file>.
This commit is contained in:
@@ -533,9 +533,9 @@ endfunction
|
|||||||
augroup gitgutter
|
augroup gitgutter
|
||||||
autocmd!
|
autocmd!
|
||||||
if g:gitgutter_on_bufenter
|
if g:gitgutter_on_bufenter
|
||||||
autocmd BufEnter,BufWritePost,FileWritePost * call GitGutter(s:current_file())
|
autocmd BufEnter,BufWritePost,FileWritePost * call GitGutter(expand('<afile>'))
|
||||||
else
|
else
|
||||||
autocmd BufReadPost,BufWritePost,FileReadPost,FileWritePost * call GitGutter(s:current_file())
|
autocmd BufReadPost,BufWritePost,FileReadPost,FileWritePost * call GitGutter(expand('<afile>'))
|
||||||
endif
|
endif
|
||||||
if g:gitgutter_all_on_focusgained
|
if g:gitgutter_all_on_focusgained
|
||||||
if !has('gui_win32')
|
if !has('gui_win32')
|
||||||
|
|||||||
Reference in New Issue
Block a user