Fix #4400 - Separate virtual text highlight groups to avoid errors

This commit is contained in:
w0rp 2022-12-27 15:36:35 +00:00
parent 3cb4f33a9a
commit fe61e00040
No known key found for this signature in database
GPG Key ID: 0FC1ECAA8C81CD83
2 changed files with 22 additions and 2 deletions

View File

@ -3,6 +3,26 @@ scriptencoding utf-8
" Author: Luan Santos <cfcluan@gmail.com>
" Description: Shows lint message for the current line as virtualtext, if any
if !hlexists('ALEVirtualTextError')
highlight link ALEVirtualTextError SpellBad
endif
if !hlexists('ALEVirtualTextStyleError')
highlight link ALEVirtualTextStyleError ALEVirtualTextError
endif
if !hlexists('ALEVirtualTextWarning')
highlight link ALEVirtualTextWarning SpellCap
endif
if !hlexists('ALEVirtualTextStyleWarning')
highlight link ALEVirtualTextStyleWarning ALEVirtualTextWarning
endif
if !hlexists('ALEVirtualTextInfo')
highlight link ALEVirtualTextInfo ALEVirtualTextWarning
endif
" Controls the milliseconds delay before showing a message.
let g:ale_virtualtext_delay = get(g:, 'ale_virtualtext_delay', 10)
let s:cursor_timer = get(s:, 'cursor_timer', -1)

View File

@ -2508,7 +2508,7 @@ ALEStyleWarningSignLineNr *ALEStyleWarningSignLineNr*
ALEVirtualTextError *ALEVirtualTextError*
Default: `highlight link ALEVirtualTextError ALEError`
Default: `highlight link ALEVirtualTextError SpellBad`
The highlight for virtualtext errors. See |g:ale_virtualtext_cursor|.
@ -2536,7 +2536,7 @@ ALEVirtualTextStyleWarning *ALEVirtualTextStyleWarning*
ALEVirtualTextWarning *ALEVirtualTextWarning*
Default: `highlight link ALEVirtualTextWarning ALEWarning`
Default: `highlight link ALEVirtualTextWarning SpellCap`
The highlight for virtualtext errors. See |g:ale_virtualtext_cursor|.