Sunday, April 5, 2020

Re: Theme dev (Selenized) help: SpellRare and undercurl not working in Vim, works in NeoVim

On Sun, Apr 5, 2020 at 12:38 PM Dominique Pellé wrote:

> If I do that:
>
> $ cat > test.vim <<EOF
> set spellfile=/tmp/en.utf8.add spelllang=en_us spell t_Co=256
> hi clear
>
> hi SpellBad guisp=red gui=undercurl guifg=NONE guibg=NONE
> ctermfg=NONE ctermbg=NONE term=undercurl cterm=undercurl
> hi SpellCap guisp=orange gui=undercurl guifg=NONE guibg=NONE
> ctermfg=NONE ctermbg=NONE term=undercurl cterm=undercurl
> hi SpellRare guisp=blue gui=undercurl guifg=NONE guibg=NONE
> ctermfg=NONE ctermbg=NONE term=undercurl cterm=undercurl
> hi SpellLocal guisp=green gui=undercurl guifg=NONE guibg=NONE
> ctermfg=NONE ctermbg=NONE term=undercurl cterm=undercurl
>
> spellrare emacs
> call setline(1, 'is your favourite edditor vim or emacs?')
> EOF
>
> $ vim -f -g --clean -S test.vim # Gives the expected undercurl in
> gvim-gtk3 (good)
> $ vim --clean -S test.vim # No undercurl and no underline in terminal (bug!)
>
> I expected that vim should fallback to underline in the terminal
> since the doc says:
>
> === BEGIN QUOTE :help undercurl ===
> "undercurl" is a curly underline. When "undercurl" is not possible
> then "underline" is used. In general "undercurl" and "strikethrough"
> is only available in the GUI.
> === END QUOTE ===
>
> A workaround is to use term=underline cterm=underline
> instead of term=undercurl cterm=undercurl as in this example:
>
> $ cat > test.vim <<EOF
> set spellfile=/tmp/en.utf8.add spelllang=en_us spell t_Co=256
> hi clear
>
> hi SpellBad guisp=red gui=undercurl guifg=NONE guibg=NONE
> ctermfg=NONE ctermbg=NONE term=underline cterm=underline
> hi SpellCap guisp=orange 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=green gui=undercurl guifg=NONE guibg=NONE
> ctermfg=NONE ctermbg=NONE term=underline cterm=underline
>
> spellrare emacs
> call setline(1, 'is your favourite edditor vim or emacs?')
> EOF
>
> Then it works as expected:
>
> $ vim --clean -S test.vim # underline in terminal (good)
>
> But still, I think that term=undercurl cterm=undercurl should
> have a fall-back on underline automatically.
>
> Regards
> Dominique

I've just built neovim and handling of undercurl is indeed nicer
with neovim. I can actually see colored undercurl in the terminal
(not even having to fallback to underline). I never realized
that some terminals support undercurls. Very nice! I'd love
to see this in Vim too. I see undercurls using neovim in at least
those terminals which are Ubuntu-18.04 standard packages:

- xfce4-terminal-0.8.4
- gnome-terminal-3.28.2

But I don't see undercurls with neovim using xterm (XTerm(330)).

And with konsole-17.12.3, neovim misbehave: it shows spurious
characters around words that should have undercurls.

I also noticed that neovim does not have the ":spellrare" command
which was introduced in vim-8.1.1838.

And I noticed yet a bug in vim. Neovim uses a blue undercurl
for both words "vim" and "emacs", whereas vim never show that "vim"
is a rare word. Using :spelldump, I can see indeed that "vim" is marked
as rare word in the en_us dictionary since there is a question mark in its
tag
vim/?25

So why isn't word "vim" highlighted as a rare word with spelllang=en_us
in vim gtk3?

Regards
Dominique

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAON-T_j1ntEfsyZq323ykLcYx_fCTY1-OCT3SOcGn6HiO2bdbA%40mail.gmail.com.

No comments:

Post a Comment