Skip to content

Commit

Permalink
Fix autocommands so GitGutter doesn't run twice on file read.
Browse files Browse the repository at this point in the history
  • Loading branch information
airblade committed Mar 18, 2013
1 parent 21a27e0 commit 7f1c104
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ This is on by default but causes a noticeable lag for some people. To turn it o
let g:gitgutter_on_bufenter = 0
```

If you turn it off, vim-gitgutter will instead run every time you read or write a buffer.


#### To stop vim-gitgutter running for all buffers on `FocusGained`

Expand Down
3 changes: 2 additions & 1 deletion plugin/gitgutter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,10 @@ endfunction

augroup gitgutter
autocmd!
autocmd BufReadPost,BufWritePost,FileReadPost,FileWritePost * call GitGutter(s:current_file())
if g:gitgutter_on_bufenter
autocmd BufEnter * call GitGutter(s:current_file())
else
autocmd BufReadPost,BufWritePost,FileReadPost,FileWritePost * call GitGutter(s:current_file())
endif
if g:gitgutter_all_on_focusgained && !has('gui_win32')
autocmd FocusGained * call GitGutterAll()
Expand Down

0 comments on commit 7f1c104

Please sign in to comment.