render new signs before deleting the old ones
this stops the sign column from flickering on and off
This commit is contained in:
parent
0c35ca4416
commit
378f74287f
@ -109,8 +109,7 @@ function! s:UpdateErrors()
|
|||||||
call s:CacheErrors()
|
call s:CacheErrors()
|
||||||
|
|
||||||
if g:syntastic_enable_signs
|
if g:syntastic_enable_signs
|
||||||
call s:ClearSigns()
|
call s:RefreshSigns()
|
||||||
call s:SignErrors()
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if g:syntastic_auto_loc_list
|
if g:syntastic_auto_loc_list
|
||||||
@ -183,13 +182,12 @@ function s:SignErrors()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"remove all SyntaxError signs in the buffer
|
"remove the signs with the given ids from this buffer
|
||||||
function! s:ClearSigns()
|
function! s:RemoveSigns(ids)
|
||||||
for i in s:BufSignIds()
|
for i in a:ids
|
||||||
exec "sign unplace " . i
|
exec "sign unplace " . i
|
||||||
|
call remove(s:BufSignIds(), index(s:BufSignIds(), i))
|
||||||
endfor
|
endfor
|
||||||
let b:syntastic_sign_ids = []
|
|
||||||
let s:next_sign_id = s:first_sign_id
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"get all the ids of the SyntaxError signs in the buffer
|
"get all the ids of the SyntaxError signs in the buffer
|
||||||
@ -200,6 +198,14 @@ function! s:BufSignIds()
|
|||||||
return b:syntastic_sign_ids
|
return b:syntastic_sign_ids
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
"update the error signs
|
||||||
|
function! s:RefreshSigns()
|
||||||
|
let old_signs = copy(s:BufSignIds())
|
||||||
|
call s:SignErrors()
|
||||||
|
call s:RemoveSigns(old_signs)
|
||||||
|
let s:first_sign_id = s:next_sign_id
|
||||||
|
endfunction
|
||||||
|
|
||||||
"display the cached errors for this buf in the location list
|
"display the cached errors for this buf in the location list
|
||||||
function! s:ShowLocList()
|
function! s:ShowLocList()
|
||||||
if exists("b:syntastic_loclist")
|
if exists("b:syntastic_loclist")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user