Add opt-out configuration for BufEnter and FocusGained.

This commit is contained in:
Andy Stewart
2013-03-15 10:53:31 +01:00
parent 04be163a3e
commit 677dac451d
3 changed files with 59 additions and 4 deletions

View File

@@ -18,6 +18,14 @@ if !exists('g:gitgutter_sign_column_always')
let g:gitgutter_sign_column_always = 0
endif
if !exists('g:gitgutter_on_bufenter')
let g:gitgutter_on_bufenter = 1
endif
if !exists('g:gitgutter_all_on_focusgained')
let g:gitgutter_all_on_focusgained = 1
endif
let s:file = ''
function! s:init()
@@ -500,7 +508,10 @@ endfunction
augroup gitgutter
autocmd!
autocmd BufReadPost,BufWritePost,FileReadPost,FileWritePost * call GitGutter(s:current_file())
if !has('gui_win32')
if g:gitgutter_on_bufenter
autocmd BufEnter * call GitGutter(s:current_file())
endif
if g:gitgutter_all_on_focusgained && !has('gui_win32')
autocmd FocusGained * call GitGutterAll()
endif
augroup END