Remove 3-argument getbufvar() for better compatibility

References #95.
This commit is contained in:
Marco Hinz 2013-11-22 16:14:28 +01:00
parent a2b0de3359
commit f7dc63e819
3 changed files with 6 additions and 8 deletions

View File

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

View File

@ -5,7 +5,7 @@ scriptencoding utf-8
" Function: #list_active_buffers {{{1
function! sy#debug#list_active_buffers() abort
for b in range(0, bufnr('$'))
if !buflisted(b) || empty(getbufvar(b, 'sy', {}))
if !buflisted(b) || empty(getbufvar(b, 'sy'))
continue
endif

View File

@ -42,17 +42,16 @@ 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='. sy.buffer
execute 'sign unplace * buffer='. b:sy.buffer
else
for hunk in sy.hunks
for hunk in b:sy.hunks
for id in hunk.ids
execute 'sign unplace' id
endfor
endfor
endif
let sy.hunks = []
let sy.stats = [0, 0, 0]
let b:sy.hunks = []
let b:sy.stats = [0, 0, 0]
endfunction