Skip to content

Commit

Permalink
When disabling, disable across all buffers.
Browse files Browse the repository at this point in the history
  • Loading branch information
airblade committed Apr 14, 2014
1 parent 47ffb2e commit a4347c5
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions autoload/gitgutter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,28 @@ function! gitgutter#process_buffer(file, realtime)
endfunction

function! gitgutter#disable()
" get list of all buffers (across all tabs)
let buflist = []
for i in range(tabpagenr('$'))
call extend(buflist, tabpagebuflist(i + 1))
endfor

for buffer_id in buflist
let file = expand('#' . buffer_id . ':p')
if !empty(file)
call utility#set_file(file)
call sign#clear_signs(utility#file())
call sign#remove_dummy_sign(1)
call hunk#reset()
endif
endfor

let g:gitgutter_enabled = 0
call sign#clear_signs(utility#file())
call sign#remove_dummy_sign(1)
call hunk#reset()
endfunction

function! gitgutter#enable()
let g:gitgutter_enabled = 1
call gitgutter#process_buffer(utility#current_file(), 0)
call gitgutter#all()
endfunction

function! gitgutter#toggle()
Expand Down

0 comments on commit a4347c5

Please sign in to comment.