diff options
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/virtualtext.vim | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/autoload/ale/virtualtext.vim b/autoload/ale/virtualtext.vim index 9fa66217..a2f88a3a 100644 --- a/autoload/ale/virtualtext.vim +++ b/autoload/ale/virtualtext.vim @@ -8,12 +8,24 @@ let g:ale_virtualtext_delay = get(g:, 'ale_virtualtext_delay', 10) let s:cursor_timer = -1 let s:last_pos = [0, 0, 0] +if !hlexists('ALEVirtualTextError') + highlight link ALEVirtualTextError ALEError +endif + +if !hlexists('ALEVirtualTextStyleError') + highlight link ALEVirtualTextStyleError ALEVirtualTextError +endif + if !hlexists('ALEVirtualTextWarning') highlight link ALEVirtualTextWarning ALEWarning endif -if !hlexists('ALEVirtualTextError') - highlight link ALEVirtualTextError ALEError +if !hlexists('ALEVirtualTextStyleWarning') + highlight link ALEVirtualTextStyleWarning ALEVirtualTextWarning +endif + +if !hlexists('ALEVirtualTextInfo') + highlight link ALEVirtualTextInfo ALEVirtualTextWarning endif function! ale#virtualtext#Clear() abort @@ -67,13 +79,21 @@ function! ale#virtualtext#ShowCursorWarning(...) abort if !empty(l:loc) let l:msg = get(l:loc, 'detail', l:loc.text) - let l:hl_group = 'ALEInfo' + let l:hl_group = 'ALEVirtualTextInfo' let l:type = get(l:loc, 'type', 'E') if l:type is# 'E' - let l:hl_group = 'ALEVirtualTextError' + if get(l:loc, 'sub_type', '') is# 'style' + let l:hl_group = 'ALEVirtualTextStyleError' + else + let l:hl_group = 'ALEVirtualTextError' + endif elseif l:type is# 'W' - let l:hl_group = 'ALEVirtualTextWarning' + if get(l:loc, 'sub_type', '') is# 'style' + let l:hl_group = 'ALEVirtualTextStyleWarning' + else + let l:hl_group = 'ALEVirtualTextWarning' + endif endif call ale#virtualtext#ShowMessage(l:msg, l:hl_group) |