altercation / vim-colors-solarized

precision colorscheme for the vim text editor
http://ethanschoonover.com/solarized
6.58k stars 1.75k forks source link

Bad spell words not visible anymore #195

Closed erikw closed 5 years ago

erikw commented 6 years ago

Hello,

I've had the same vim configuration in regards to using solarized colorscheme and how my spelling is configured, for years and years. But today, possibly when I updated to vim-runtime 8.0.1389-1 in Arch, misspelled words stopped being underlined in terminal vim.

This is how it currenlty looks, bad word is not highlighted as it should:

screenshot_2017-12-15-224931_260x145

The spelling works in gvim+solarized and in terminal with other colorschemes.

I noticed that in the terminal SpellBad is set to

:hi SpellBad
SpellBad       xxx term=undercurl cterm=undercurl gui=undercurl guisp=Red

and I see from

:h undercurl
undercurl       not always available

So when I change vim-colors-solarized to user underline for terminal always instead of undercurl, this patch,

diff --git a/colors/solarized.vim b/colors/solarized.vim
index 70f5223..57f7372 100644
--- a/colors/solarized.vim
+++ b/colors/solarized.vim
@@ -360,7 +360,7 @@ endif
     let s:none            = "NONE"
     let s:t_none          = "NONE"
     let s:n               = "NONE"
-    let s:c               = ",undercurl"
+    let s:c               = ",underline"
     let s:r               = ",reverse"
     let s:s               = ",standout"
     let s:ou              = ""

and now the misspelled word are underlined as they have been for years for me!

screenshot_2017-12-15-224953_282x140

What could be the cause of this? Is there any reason for having undercurl set instead of underline for terminals? For GUI it makes sense to have the fancier undercurl of course, but not for terminal.

If not, I suggest my patch above =).

luketurcotte commented 6 years ago

Thanks for the suggested patch! I ran into this issue as well.

KenKundert commented 6 years ago

The suggested patch changes the way spelling errors are highlighted in gvim as well. You can leave gvim unchanged while fixing vim using:

if (has("gui_running"))
    let s:c = ",undercurl"                                     
else                                                                         
    let s:c = ",underline"                                     
endif

This should not be necessary. :help undercurl clearly says that when undercurl is not available underline will be used, but this must be broken in this release of vim.

jflorian commented 6 years ago

https://github.com/vim/vim/issues/2424 looks relevant.

joshklod commented 5 years ago

@jflorian

vim/vim#2424 looks relevant.

Indeed, this issue is due to that bug. Solarized is not the problem, as @KenKundert pointed out.

@erikw

I'm guessing this has been fixed by now, in which case this issue can be closed. If not, try adding set t_Cs= to your vimrc. That workaround is sufficient in some versions of Vim.

erikw commented 5 years ago

@joshklod I can confirm that it works now in vim 8.1.0374! I'm closing the ticket.