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: #stop {{{1
function! sy#stop(bnum) abort function! sy#stop(bnum) abort
let bvars = getbufvar(a:bnum, '', {}) if !exists('b:sy')
if !has_key(bvars, 'sy')
return return
endif endif

View File

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

View File

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