Add specific highlight groups for virtualtext (#2071)
This commit is contained in:
parent
3948638dbe
commit
f64f9aba16
@ -8,6 +8,14 @@ let g:ale_virtualtext_delay = get(g:, 'ale_virtualtext_delay', 10)
|
|||||||
let s:cursor_timer = -1
|
let s:cursor_timer = -1
|
||||||
let s:last_pos = [0, 0, 0]
|
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
|
function! ale#virtualtext#Clear() abort
|
||||||
if !has('nvim-0.3.2')
|
if !has('nvim-0.3.2')
|
||||||
return
|
return
|
||||||
@ -63,9 +71,9 @@ function! ale#virtualtext#ShowCursorWarning(...) abort
|
|||||||
let l:type = get(l:loc, 'type', 'E')
|
let l:type = get(l:loc, 'type', 'E')
|
||||||
|
|
||||||
if l:type is# 'E'
|
if l:type is# 'E'
|
||||||
let l:hl_group = 'ALEError'
|
let l:hl_group = 'ALEVirtualTextError'
|
||||||
elseif l:type is# 'W'
|
elseif l:type is# 'W'
|
||||||
let l:hl_group = 'ALEWarning'
|
let l:hl_group = 'ALEVirtualTextWarning'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call ale#virtualtext#ShowMessage(l:msg, l:hl_group)
|
call ale#virtualtext#ShowMessage(l:msg, l:hl_group)
|
||||||
|
@ -1891,9 +1891,13 @@ g:ale_virtualtext_cursor *g:ale_virtua
|
|||||||
|
|
||||||
Messages can be prefixed prefixed with a string. See |g:ale_virtualtext_prefix|.
|
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*
|
g:ale_virtualtext_delay *g:ale_virtualtext_delay*
|
||||||
*b:ale_virtualtext_delay*
|
b:ale_virtualtext_delay *b:ale_virtualtext_delay*
|
||||||
Type: |Number|
|
Type: |Number|
|
||||||
Default: `10`
|
Default: `10`
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user