dracula/vim

Not able to see the NonText

ddaza opened this issue · 10 comments

ddaza commented

What happened

I have setup my NonText items to show in my config

set listchars=tab:❘·,trail:·,nbsp:·,precedes:«,extends:»,eol:↵

And I am unable to see these when I have both a cursor line and non text in a new empty line.

What I expected to happen

Expected to show something like this.
Screen Shot 2021-04-28 at 10 01 45 AM

Showing this
Screen Shot 2021-04-28 at 10 02 56 AM

Machine Info

  • Vim type (vim/gvim/neovim): NVIM
  • Vim version: v0.4.4
  • OS: osx
  • Terminal/Terminal Emulator/VTE: alacritty
  • TERM environment variable: xterm-256color

Additional Info

Perhaps the cursorline is the same color and therefore hiding the symbols? if you move the cursor, do they appear? This is true for me in alacritty with a custom terminfo and termguicolors (I've actually stopped using cursorline).

(There was an issue somewhere else about something similar, maybe? Part of the issue is that vim uses maybe one or two colors for the listchars stuff, while neovim uses slightly different ones, maybe more, making it hard to get consistent. e.g., IIRC, @dsifford uses neovim and his trailing whitespace shows up as red?)

ddaza commented

They never appear when I have my cursor line ON and on a line.
And you are correct, the color of the CursorLine and the NonText is the same, so I think that is the culprit.
I had to manually change the colors to make them appear.

DraculaSubtle and CursorLine are the same color.

call s:h('DraculaSubtle', s:subtle)

hi! link NonText DraculaSubtle

vim/colors/dracula.vim

Lines 208 to 211 in d82b919

call s:h('CursorLine', s:none, s:subtle)
hi! link ColorColumn DraculaBgDark
hi! link CursorColumn CursorLine

ddaza commented

these were my changes to make it show.

diff --git a/autoload/dracula.vim b/autoload/dracula.vim
index 23f9656..cc43371 100644
--- a/autoload/dracula.vim
+++ b/autoload/dracula.vim
@@ -12,6 +12,7 @@ let g:dracula#palette.bgdarker  = ['#191A21', 234]
 let g:dracula#palette.comment   = ['#6272A4',  61]
 let g:dracula#palette.selection = ['#44475A', 239]
 let g:dracula#palette.subtle    = ['#424450', 238]
+let g:dracula#palette.less_subtle = ['#77777', 243]
 
 let g:dracula#palette.cyan      = ['#8BE9FD', 117]
 let g:dracula#palette.green     = ['#50FA7B',  84]
diff --git a/colors/dracula.vim b/colors/dracula.vim
index 1d0c17c..55c339d 100644
--- a/colors/dracula.vim
+++ b/colors/dracula.vim
@@ -42,6 +42,7 @@ let s:bgdarker  = g:dracula#palette.bgdarker
 let s:comment   = g:dracula#palette.comment
 let s:selection = g:dracula#palette.selection
 let s:subtle    = g:dracula#palette.subtle
+let s:less_subtle = g:dracula#palette.less_subtle
 
 let s:cyan      = g:dracula#palette.cyan
 let s:green     = g:dracula#palette.green
@@ -148,6 +149,7 @@ call s:h('DraculaCommentBold', s:comment, s:none, [s:attrs.bold])
 call s:h('DraculaSelection', s:none, s:selection)
 
 call s:h('DraculaSubtle', s:subtle)
+call s:h('DraculaLessSubtle', s:less_subtle)
 
 call s:h('DraculaCyan', s:cyan)
 call s:h('DraculaCyanItalic', s:cyan, s:none, [s:attrs.italic])
@@ -223,7 +225,7 @@ hi! link Folded       DraculaBoundary
 hi! link IncSearch    DraculaOrangeInverse
 call s:h('LineNr', s:comment)
 hi! link MoreMsg      DraculaFgBold
-hi! link NonText      DraculaSubtle
+hi! link NonText      DraculaLessSubtle
 hi! link Pmenu        DraculaBgDark
 hi! link PmenuSbar    DraculaBgDark
 hi! link PmenuSel     DraculaSelection

Well, we probably need to discuss this as it relates to the spec. I'm all for fixing it, with @dsifford 's input.

In the meantime, you can fix it locally without modifying the plugin with a ColorScheme autocommand.

This kind of thing has always been sort of a thorn in my side. The highlighted line style makes it sort of tricky because there are scenarios where there are 3 or more layerings of backgrounds at any given time...

Example:

+/- search highlight
+/- selection
line highlight
base layer

Additionally, I've always tried to avoid navigating off the standard spec-aligned colors wherever possible.

All that said, I'm open to whatever the group feels is the best approach here.

Could we get a screenshot with your particular fix ?

At the risk of irking people with the change, could we make the non-text a subtle non-grey color ?

ddaza commented

The image I provided of what is expected is the one that has the potential fix.

Related: #192 #210

The thing that worked for me for NVIM, was adding the following to my init.vim file:

highlight NonText guifg=#666666

after the line with colorscheme dracula

You also need to have set termguicolors

and the result looks like this
image

Can we consider this resolved or no?