Open esan0 opened 1 year ago
I would like to fix this, but I'm not sure how to fix it.
Confirming that adding the following to vimrc
seems to do the trick:
function! TogBG() abort
highlight link ALEVirtualTextError Comment
highlight link ALEVirtualTextStyleError ALEVirtualTextError
highlight link ALEVirtualTextWarning Comment
highlight link ALEVirtualTextStyleWarning ALEVirtualTextWarning
highlight link ALEVirtualTextInfo ALEVirtualTextWarning
endfunction
autocmd ColorScheme * call TogBG()
Information
VIM version VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Oct 01 2023 12:12:50) Included patches: 1-1968
Operating System: $ uname -r 6.5.5-arch1-1
What went wrong
When the colorscheme gets reloaded, virtualtext loses its "comment" highlighting.
Clean vim loaded:
reload colorscheme
I was able to get around this partially by adding the following to the function that manually toggles
background
(and thus reloads the colorscheme):However, this doesn't solve the problem when the colorscheme is reloaded automatically, for example, when my terminal background gets changed and vim follows that change.
I'm also suspicious that if these highlight groups get somehow reset, then other non-visible items may also silently reset. In fact, I also have to add ALEError and ALEWarning
cterm=undercurl
in the manual function, too, because they get reset to underline.Reproducing the bug
And the virtualtext at the end of the cursor is no longer italic and light (see figures above)
:ALEInfo