From c05eecc0bddcec6d62537e342e57d536a1917b3d Mon Sep 17 00:00:00 2001 From: Kim Christensen Date: Mon, 25 Mar 2013 09:13:51 +0100 Subject: [PATCH] Will only remove signs known from the previous quickfix list, if any. Fix for klen/python-mode#185 --- autoload/pymode.vim | 9 +++++++-- autoload/pymode/lint.vim | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/autoload/pymode.vim b/autoload/pymode.vim index 12e2baba..e3893cab 100644 --- a/autoload/pymode.vim +++ b/autoload/pymode.vim @@ -49,13 +49,18 @@ fun! pymode#QuickfixOpen(onlyRecognized, holdCursor, maxHeight, minHeight, jumpE endif endfunction "}}} +fun! pymode#RemoveSigns() "{{{ + if has('signs') + for item in filter(getqflist(), 'v:val.bufnr != ""') + execute printf('silent! sign unplace 1 buffer=%d', item.bufnr) + endfor + endif +endfunction "}}} fun! pymode#PlaceSigns() "{{{ " DESC: Place error signs " if has('signs') - sign unplace * - if !pymode#Default("g:pymode_lint_signs_always_visible", 0) || g:pymode_lint_signs_always_visible call RopeShowSignsRulerIfNeeded() endif diff --git a/autoload/pymode/lint.vim b/autoload/pymode/lint.vim index e9c891f7..3e834bda 100644 --- a/autoload/pymode/lint.vim +++ b/autoload/pymode/lint.vim @@ -23,6 +23,10 @@ endfunction " }}} fun! pymode#lint#Parse() " DESC: Parse result of code checking. " + if g:pymode_lint_signs + call pymode#RemoveSigns() + endif + call setqflist(g:qf_list, 'r') if g:pymode_lint_signs