Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to see the NonText #247

Open
ddaza opened this issue Apr 28, 2021 · 10 comments
Open

Not able to see the NonText #247

ddaza opened this issue Apr 28, 2021 · 10 comments

Comments

@ddaza
Copy link

ddaza commented Apr 28, 2021

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

@benknoble
Copy link
Member

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
Copy link
Author

ddaza commented Apr 28, 2021

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
Copy link
Author

ddaza commented Apr 28, 2021

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
Copy link
Member

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
Copy link
Member

dsifford commented Apr 28, 2021

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
Copy link
Member

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
Copy link
Author

ddaza commented Apr 28, 2021

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

@benknoble
Copy link
Member

Related: #192 #210

benknoble added a commit that referenced this issue May 20, 2021
Related: #192, #210, #248

Also #247 is about `NonText`, which needs investigating.

Issues: `:digraphs`, special keys in `:map` output, and certain parts of
`'listchars'` are "subtle" and hard to read (esp. w/ `cursorline` over
them). Also, vim uses `SpecialKey` for them (instead of `Whitespace` for
`'listchars'` and `SpecialKey` elsewhere, like NeoVim).

Fix: make `SpecialKey` more like special keys (the highlight in vimscript
for, e.g., `map <Space> :echo "hello"<CR>`). This has the side effect of
making digraphs more visible. It also makes certain `'listchars'` pink,
which may be annoying. But there is no way currently to separate the two
in vim.

Rationale: It matches with the special keys in maps. The fact that vim
uses it elsewhere may simply be "wrong" and need changed.

If you don't like it: well, as usual, you can use an autocommand to use
whatever colors you want (`:help dracula-customization`).
dsifford pushed a commit that referenced this issue Jun 4, 2021
Related: #192, #210, #248

Also #247 is about `NonText`, which needs investigating.

Issues: `:digraphs`, special keys in `:map` output, and certain parts of
`'listchars'` are "subtle" and hard to read (esp. w/ `cursorline` over
them). Also, vim uses `SpecialKey` for them (instead of `Whitespace` for
`'listchars'` and `SpecialKey` elsewhere, like NeoVim).

Fix: make `SpecialKey` more like special keys (the highlight in vimscript
for, e.g., `map <Space> :echo "hello"<CR>`). This has the side effect of
making digraphs more visible. It also makes certain `'listchars'` pink,
which may be annoying. But there is no way currently to separate the two
in vim.

Rationale: It matches with the special keys in maps. The fact that vim
uses it elsewhere may simply be "wrong" and need changed.

If you don't like it: well, as usual, you can use an autocommand to use
whatever colors you want (`:help dracula-customization`).
@danielnieto
Copy link

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
Copy link
Member

Can we consider this resolved or no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants