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

This commit is contained in:
w0rp 2017-12-07 23:25:17 +00:00
parent b6efb5649e
commit 7d932a239c

View File

@ -95,6 +95,12 @@ function! ale#highlight#UpdateHighlights() abort
" If highlights are enabled and signs are not enabled, we should still
" offer line highlights by adding a separate set of highlights.
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
if l:item.type is# 'W'
let l:group = 'ALEWarningLine'
@ -104,7 +110,9 @@ function! ale#highlight#UpdateHighlights() abort
let l:group = 'ALEErrorLine'
endif
if l:available_groups[l:group]
call matchaddpos(l:group, [l:item.lnum])
endif
endfor
endif
endfunction