summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2022-12-27 15:36:35 +0000
committerw0rp <devw0rp@gmail.com>2022-12-27 15:36:35 +0000
commitfe61e0004075e8502b18eca152ad9ecce1d9c3a1 (patch)
treed029f7b377f38960d40fa9a6830df11aacab0582
parent3cb4f33a9a9a53cc8c10952aecfa9bca1afcbe4c (diff)
downloadale-fe61e0004075e8502b18eca152ad9ecce1d9c3a1.zip
Fix #4400 - Separate virtual text highlight groups to avoid errors
-rw-r--r--autoload/ale/virtualtext.vim20
-rw-r--r--doc/ale.txt4
2 files changed, 22 insertions, 2 deletions
diff --git a/autoload/ale/virtualtext.vim b/autoload/ale/virtualtext.vim
index cd71ef85..6f4e500f 100644
--- a/autoload/ale/virtualtext.vim
+++ b/autoload/ale/virtualtext.vim
@@ -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)
diff --git a/doc/ale.txt b/doc/ale.txt
index 65a551a7..ebc5489c 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -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|.