dracula / vim

🧛🏻‍♂️ Dark theme for Vim
https://draculatheme.com/vim
MIT License
1.32k stars 455 forks source link

Not able to see the NonText #247

Open ddaza opened 3 years ago

ddaza commented 3 years ago

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

Additional Info

benknoble commented 3 years ago

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 3 years ago

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.

https://github.com/dracula/vim/blob/d82b9198d4dda1ac4a96756570f56125a1f86cb1/colors/dracula.vim#L150 https://github.com/dracula/vim/blob/d82b9198d4dda1ac4a96756570f56125a1f86cb1/colors/dracula.vim#L226 https://github.com/dracula/vim/blob/d82b9198d4dda1ac4a96756570f56125a1f86cb1/colors/dracula.vim#L208-L211

ddaza commented 3 years ago

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
benknoble commented 3 years ago

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.

dsifford commented 3 years ago

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.

benknoble commented 3 years ago

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 3 years ago

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

benknoble commented 3 years ago

Related: #192 #210

danielnieto commented 2 years ago

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
benknoble commented 2 years ago

Can we consider this resolved or no?