Describe the bug
After patch 8.2.863, I see underlines with colors for spelling mistakes when doing:
$ cat foo.vim
hi SpellBad guisp=red gui=undercurl guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=underline cterm=underline
hi SpellCap guisp=yellow gui=undercurl guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=underline cterm=underline
hi SpellRare guisp=blue gui=undercurl guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=underline cterm=underline
hi SpellLocal guisp=orange gui=undercurl guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=underline cterm=underline
set termguicolors
" A text with spellling mistake in vim. check that underline or undercurl are OK.
$ vim --clean foo.vim -c 'set spell spelllang=en_us termguicolors' -c 'so %'
That's nice. However, since 'termguicolors', is set, it would have been more appropriate to show colored undercurls instead of colored underlines.
In fact, doing the same steps with neovim, I see that neovim does show colored undercurls in the terminal.
$ nvim --clean foo.vim -c 'set spell spelllang=en_us termguicolors' -c 'so %'
I see that at least xfce4-terminal, gnome-terminal support undercurl with neovim.
Environment
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Let's first make sure that it works without 'termguicolors':
let &t_Cs = "\e[4:3m" let &t_Ce = "\e[4:0m" hi SpellBad guisp=red gui=undercurl guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=underline cterm=undercurl ctermul=red hi SpellCap guisp=yellow gui=undercurl guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=underline cterm=undercurl ctermul=yellow
Note that "cterm=undercurl" is used. This works for me in a gnome-terminal.
After setting 'termguicolors' it still works. Note that the "cterm" argument is not affected by 'termguicolors'. So you can have different attributes in the GUI and in a terminal. For example when undercurl doesn't work, like in an xterm.
@brammool wrote:
Note that "cterm=undercurl" is used. This works for me in a gnome-terminal.
This also works fine for me (i.e. see colored undercurl) at least with those terminals that are Ubuntu-18.04 packages:
But it does not work in:
:terminal) which use libvterm, same behavior as in xtermCan 't_Cs' and 't_Ce' be set automatically for terminals that are known to support undercurl?
I do not know how to detect that a terminal supports undercurl. We can recognize a few terminals, but usually not the patchlevel. And I don't know at what patchlevel the feature has been implemented.
The normal way is that the termcap/terminfo is accurate.
Closed #6174.