Reduce screen shaking by leaving the dummy sign in place while signs are being added and removed.
This commit is contained in:
parent
6ff4ed93a7
commit
ab555a6984
@ -36,6 +36,7 @@ execute 'sign define ALEErrorSign text=' . g:ale_sign_error
|
|||||||
\ . ' texthl=ALEErrorSign'
|
\ . ' texthl=ALEErrorSign'
|
||||||
execute 'sign define ALEWarningSign text=' . g:ale_sign_warning
|
execute 'sign define ALEWarningSign text=' . g:ale_sign_warning
|
||||||
\ . ' texthl=ALEWarningSign'
|
\ . ' texthl=ALEWarningSign'
|
||||||
|
sign define ALEDummySign
|
||||||
|
|
||||||
function! ale#sign#FindCurrentSigns(buffer)
|
function! ale#sign#FindCurrentSigns(buffer)
|
||||||
" Matches output like :
|
" Matches output like :
|
||||||
@ -93,8 +94,9 @@ function! ale#sign#SetSigns(buffer, loclist)
|
|||||||
let signlist = ale#sign#CombineSigns(a:loclist)
|
let signlist = ale#sign#CombineSigns(a:loclist)
|
||||||
|
|
||||||
" Insert a dummy sign if one is missing.
|
" Insert a dummy sign if one is missing.
|
||||||
" We will only insert the dummy sign at most once.
|
execute 'sign place ' . g:ale_sign_dummy_id
|
||||||
call ale#sign#InsertDummy(len(signlist))
|
\ . ' line=1 name=ALEDummySign buffer='
|
||||||
|
\ . a:buffer
|
||||||
|
|
||||||
" Find the current signs with the markers we use.
|
" Find the current signs with the markers we use.
|
||||||
let current_id_list = ale#sign#FindCurrentSigns(a:buffer)
|
let current_id_list = ale#sign#FindCurrentSigns(a:buffer)
|
||||||
@ -116,16 +118,8 @@ function! ale#sign#SetSigns(buffer, loclist)
|
|||||||
|
|
||||||
exec sign_line
|
exec sign_line
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Show sign gutter if there are no signs and g:ale_sign_column_always is set to 1
|
if !g:ale_sign_column_always
|
||||||
function! ale#sign#InsertDummy(no_signs)
|
execute 'sign unplace ' . g:ale_sign_dummy_id . ' buffer=' . a:buffer
|
||||||
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('')
|
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user