Skip to content

Commit

Permalink
Use correct filename in auto commands.
Browse files Browse the repository at this point in the history
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>.
  • Loading branch information
airblade committed Apr 12, 2013
1 parent d4a1a60 commit 25d428c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/gitgutter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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('<afile>'))
else
autocmd BufReadPost,BufWritePost,FileReadPost,FileWritePost * call GitGutter(s:current_file())
autocmd BufReadPost,BufWritePost,FileReadPost,FileWritePost * call GitGutter(expand('<afile>'))
endif
if g:gitgutter_all_on_focusgained
if !has('gui_win32')
Expand Down

0 comments on commit 25d428c

Please sign in to comment.