diff --git a/autoload/sy/sign.vim b/autoload/sy/sign.vim index 98a2b47..5442b90 100644 --- a/autoload/sy/sign.vim +++ b/autoload/sy/sign.vim @@ -23,32 +23,37 @@ endfunction " Function: #set {{{1 function! sy#sign#set(signs) let hunk = { 'ids': [], 'start': a:signs[0].lnum, 'end': a:signs[-1].lnum } + for sign in a:signs " Preserve non-signify signs if !g:signify_sign_overwrite && has_key(s:other_signs_line_numbers, sign.lnum) - next + continue endif call add(hunk.ids, g:id_top) - execute 'sign place '. g:id_top .' line='. sign.lnum .' name='. sign.type .' file='. sign.path + execute 'sign place' g:id_top 'line='. sign.lnum 'name='. sign.type 'file='. sign.path let g:id_top += 1 endfor + call add(g:sy[sign.path].hunks, hunk) endfunction " Function: #remove_all {{{1 function! sy#sign#remove_all(path) abort - for hunk in g:sy[a:path].hunks - for id in hunk.ids - execute 'sign unplace '. id + if g:signify_sign_overwrite + sign unplace * + else + for hunk in g:sy[a:path].hunks + for id in hunk.ids + execute 'sign unplace' id + endfor endfor - endfor + endif let s:other_signs_line_numbers = {} let g:sy[a:path].hunks = [] let g:sy[a:path].stats = [0, 0, 0] endfunction - " vim: et sw=2 sts=2