diff --git a/ftplugin/python/coveragepy.vim b/ftplugin/python/coveragepy.vim index 250a29c..0c9ca5e 100755 --- a/ftplugin/python/coveragepy.vim +++ b/ftplugin/python/coveragepy.vim @@ -84,14 +84,17 @@ endfunction function! s:ClearSigns() abort - let placements = split(execute('sign place file=' . bufname('%')), '\n') - let fname = bufname('%') + let buf = bufnr('%') + let placements = split(execute('sign place buffer='.buf), '\n') for s in placements let cols = split(s) + let id = split(cols[1], '=')[-1] + if id !=# s:sign_id + continue + endif let name = split(cols[-1], '=')[-1] - if name[0:8] ==# 'uncovered' - let id = s:sign_id - exe printf('sign unplace %d file=%s', id, fname) + if name[-9:] ==# 'uncovered' + exe printf('sign unplace %d buffer=%d', s:sign_id, buf) endif endfor endfunction