From ab555a6984e9979168c5c37080f6595ee4048ec9 Mon Sep 17 00:00:00 2001 From: w0rp Date: Wed, 5 Oct 2016 09:31:11 +0100 Subject: [PATCH] Reduce screen shaking by leaving the dummy sign in place while signs are being added and removed. --- plugin/ale/sign.vim | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/plugin/ale/sign.vim b/plugin/ale/sign.vim index 1fce84f..7d7802d 100644 --- a/plugin/ale/sign.vim +++ b/plugin/ale/sign.vim @@ -36,6 +36,7 @@ execute 'sign define ALEErrorSign text=' . g:ale_sign_error \ . ' texthl=ALEErrorSign' execute 'sign define ALEWarningSign text=' . g:ale_sign_warning \ . ' texthl=ALEWarningSign' +sign define ALEDummySign function! ale#sign#FindCurrentSigns(buffer) " Matches output like : @@ -93,8 +94,9 @@ function! ale#sign#SetSigns(buffer, loclist) let signlist = ale#sign#CombineSigns(a:loclist) " Insert a dummy sign if one is missing. - " We will only insert the dummy sign at most once. - call ale#sign#InsertDummy(len(signlist)) + execute 'sign place ' . g:ale_sign_dummy_id + \ . ' line=1 name=ALEDummySign buffer=' + \ . a:buffer " Find the current signs with the markers we use. let current_id_list = ale#sign#FindCurrentSigns(a:buffer) @@ -116,16 +118,8 @@ function! ale#sign#SetSigns(buffer, loclist) exec sign_line endfor -endfunction -" Show sign gutter if there are no signs and g:ale_sign_column_always is set to 1 -function! ale#sign#InsertDummy(no_signs) - if g:ale_sign_column_always == 1 && a:no_signs == 0 - sign define ALEDummySign - execute 'sign place ' - \ . g:ale_sign_dummy_id - \ . ' line=1 name=ALEDummySign buffer=' - \ . bufnr('') + if !g:ale_sign_column_always + execute 'sign unplace ' . g:ale_sign_dummy_id . ' buffer=' . a:buffer endif endfunction -