From d77d0a6e362a6f4d182a102b84efabe470a6389b Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 1 Jun 2019 19:38:34 +0200 Subject: [PATCH 1/2] Fix clearing signs: also clear branchuncovered signs --- ftplugin/python/coveragepy.vim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ftplugin/python/coveragepy.vim b/ftplugin/python/coveragepy.vim index 250a29c..7e70793 100755 --- a/ftplugin/python/coveragepy.vim +++ b/ftplugin/python/coveragepy.vim @@ -88,10 +88,13 @@ function! s:ClearSigns() abort let fname = bufname('%') 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 file=%s', s:sign_id, fname) endif endfor endfunction From bf9031df71651dd9a70d0eb1015ed44f72381b70 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 1 Jun 2019 19:46:55 +0200 Subject: [PATCH 2/2] minor: s:ClearSigns: use buffer --- ftplugin/python/coveragepy.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ftplugin/python/coveragepy.vim b/ftplugin/python/coveragepy.vim index 7e70793..0c9ca5e 100755 --- a/ftplugin/python/coveragepy.vim +++ b/ftplugin/python/coveragepy.vim @@ -84,8 +84,8 @@ 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] @@ -94,7 +94,7 @@ function! s:ClearSigns() abort endif let name = split(cols[-1], '=')[-1] if name[-9:] ==# 'uncovered' - exe printf('sign unplace %d file=%s', s:sign_id, fname) + exe printf('sign unplace %d buffer=%d', s:sign_id, buf) endif endfor endfunction