Prevent potential regressions

References #95.
This commit is contained in:
Marco Hinz 2013-11-22 16:44:00 +01:00
parent f7dc63e819
commit 6ecab1b621
3 changed files with 9 additions and 7 deletions

View File

@ -96,7 +96,8 @@ endfunction
" Function: #stop {{{1
function! sy#stop(bnum) abort
if !exists('b:sy')
let bvars = getbufvar(a:bnum, '')
if empty(bvars) || !has_key(bvars, 'sy')
return
endif

View File

@ -42,16 +42,18 @@ endfunction
" Function: #remove_all {{{1
function! sy#sign#remove_all(bnum) abort
let sy = getbufvar(a:bnum, 'sy')
if g:signify_sign_overwrite
execute 'sign unplace * buffer='. b:sy.buffer
execute 'sign unplace * buffer='. sy.buffer
else
for hunk in b:sy.hunks
for hunk in sy.hunks
for id in hunk.ids
execute 'sign unplace' id
endfor
endfor
endif
let b:sy.hunks = []
let b:sy.stats = [0, 0, 0]
let sy.hunks = []
let sy.stats = [0, 0, 0]
endfunction

View File

@ -14,8 +14,7 @@ augroup signify
autocmd VimEnter * call sy#highlight#setup()
autocmd BufRead,BufEnter * let b:sy_path = resolve(expand('<afile>:p'))
autocmd BufRead,BufWritePost * call sy#start(b:sy_path)
autocmd BufDelete * call sy#stop(expand('<abuf>'))
autocmd BufDelete * call sy#stop(expand('<abuf>'))
if get(g:, 'signify_update_on_bufenter')
autocmd BufEnter * nested