Fix #1205 Do not add line highlights if the groups do not exist

Este commit está contenido en:
w0rp 2017-12-07 23:25:17 +00:00
padre b6efb5649e
commit 7d932a239c
Se han modificado 1 ficheros con 9 adiciones y 1 borrados

Ver fichero

@ -95,6 +95,12 @@ function! ale#highlight#UpdateHighlights() abort
" If highlights are enabled and signs are not enabled, we should still " If highlights are enabled and signs are not enabled, we should still
" offer line highlights by adding a separate set of highlights. " offer line highlights by adding a separate set of highlights.
if !g:ale_set_signs if !g:ale_set_signs
let l:available_groups = {
\ 'ALEWarningLine': hlexists('ALEWarningLine'),
\ 'ALEInfoLine': hlexists('ALEInfoLine'),
\ 'ALEErrorLine': hlexists('ALEErrorLine'),
\}
for l:item in l:item_list for l:item in l:item_list
if l:item.type is# 'W' if l:item.type is# 'W'
let l:group = 'ALEWarningLine' let l:group = 'ALEWarningLine'
@ -104,7 +110,9 @@ function! ale#highlight#UpdateHighlights() abort
let l:group = 'ALEErrorLine' let l:group = 'ALEErrorLine'
endif endif
call matchaddpos(l:group, [l:item.lnum]) if l:available_groups[l:group]
call matchaddpos(l:group, [l:item.lnum])
endif
endfor endfor
endif endif
endfunction endfunction