New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect highlighting with termguicolors, cursorline and spell #1343
Comments
OK I have a fix for this. Bens-MacBook-Pro:vim2 ben$ git diff
diff --git a/src/syntax.c b/src/syntax.c
index 75ede361c..ef0e45791 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -8765,6 +8765,8 @@ hl_combine_attr(int char_attr, int prim_attr)
else
{
vim_memset(&new_en, 0, sizeof(new_en));
+ new_en.ae_u.cterm.bg_rgb = INVALCOLOR;
+ new_en.ae_u.cterm.fg_rgb = INVALCOLOR;
if (char_attr <= HL_ALL)
new_en.ae_attr = char_attr;
} PR incoming. |
The 'uninitialised' value for RGB values is INVALCOLOR, but new entries in the cterm_attr_table were initialised to 0, meaning black. Fixes vim#1343
I have a test case which shows this is not restricted to just
set termguicolors
set cursorline
syntax clear
highlight clear
syntax enable
syntax on
function! s:Setup()
syntax keyword Test Splelling
hi! Normal cterm=NONE gui=NONE ctermfg=12 guifg=white ctermbg=8 guibg=black
"hi! SpellBad cterm=NONE,undercurl gui=NONE,undercurl ctermfg=NONE guifg=NONE ctermbg=NONE guibg=NONE guisp=#d33682
hi! Comment cterm=NONE,undercurl gui=NONE,undercurl ctermfg=NONE guifg=NONE ctermbg=NONE guibg=NONE guisp=#d33682
hi link Test Comment
endfunction
autocmd BufReadPost * call s:Setup()
|
The 'uninitialised' value for RGB values is INVALCOLOR, but new entries in the cterm_attr_table were initialised to 0, meaning black. Fixes vim#1343
Fixed by #1344 (review) / 0cdb72a |
Issue
When the
termguicolors
,spell
andcursorline
are set and theNormal
highlight group sets a background colour, misspelled words are rendered incorrectly when they appear outside of another highlighting group and the cursor is on that line.Steps to reproduce
vimrc_hl_test
with the following contents:vim -Nu vimrc_hl_test
and typeSlpelling error.<ESC>j
Expected behaviour
The word
Slpelling
is rendered underlined with a foreground colour of 'white'Actual behaviour
The word
Slpelling
is rendered underlined, but with a foreground colour of 'black'.Follow-ups
guifg
andguibg
on theNormal
group do not change the behaviour. It appears still rendered as black.set notermguicolors
- The text is rendered as expected (or at least the same colour as the other text)Installed versions, environment etc.
OS: macOS
Vim: master as of today (c4bfeda)
True color terminal: iterm2
Please don't hesitate to ask if further information is required. I'm afraid I don't currently have a true colour xterm to test in for a more canonical environment.
The text was updated successfully, but these errors were encountered: