Add specific highlight groups for virtualtext (#2071)

This commit is contained in:
jamestthompson3 2018-11-14 18:21:35 +02:00 committed by w0rp
parent 3948638dbe
commit f64f9aba16
2 changed files with 15 additions and 3 deletions

View File

@ -8,6 +8,14 @@ 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('ALEVirtualTextWarning')
highlight link ALEVirtualTextWarning ALEWarning
endif
if !hlexists('ALEVirtualTextError')
highlight link ALEVirtualTextError ALEError
endif
function! ale#virtualtext#Clear() abort
if !has('nvim-0.3.2')
return
@ -63,9 +71,9 @@ function! ale#virtualtext#ShowCursorWarning(...) abort
let l:type = get(l:loc, 'type', 'E')
if l:type is# 'E'
let l:hl_group = 'ALEError'
let l:hl_group = 'ALEVirtualTextError'
elseif l:type is# 'W'
let l:hl_group = 'ALEWarning'
let l:hl_group = 'ALEVirtualTextWarning'
endif
call ale#virtualtext#ShowMessage(l:msg, l:hl_group)

View File

@ -1891,9 +1891,13 @@ g:ale_virtualtext_cursor *g:ale_virtua
Messages can be prefixed prefixed with a string. See |g:ale_virtualtext_prefix|.
Message appearance can be changed by modifying these highlight groups:
|ALEVirtualTextError| |ALEVirtualTextWarning|
g:ale_virtualtext_delay *g:ale_virtualtext_delay*
*b:ale_virtualtext_delay*
b:ale_virtualtext_delay *b:ale_virtualtext_delay*
Type: |Number|
Default: `10`