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

E420 when hi Normal has ctermbg=None #131

Closed
pansz opened this issue Feb 6, 2012 · 6 comments
Closed

E420 when hi Normal has ctermbg=None #131

pansz opened this issue Feb 6, 2012 · 6 comments
Labels

Comments

@pansz
Copy link

pansz commented Feb 6, 2012

When Normal highlight has ctermbg=None, this means a transparent term background, i.e. the same color as the background of Term Client Program, if the term client supports a picture as background, then the background will be the picture. This technique was widely used when we need a background picture for term client.

Vim will issue E420 when ctermfg=bg, if ctermbg=None

The following line:

sil! exe 'hi CtrlPLinePre '.( has("gui_running") ? 'gui' : 'cterm' ).'fg=bg'

should not be used since ctermfg=bg may fail.

Well, I don't know why ctermfg=bg is used, do you want to Hide the foreground? Will this work?

hi link CtrlPLinePre Ignore

@pansz
Copy link
Author

pansz commented Feb 6, 2012

I had tried to use

hi link CtrlPLinePre Ignore

And it seems to work great.

@kien
Copy link
Owner

kien commented Feb 6, 2012

I already made some changes that should (unintentionally) fix this, I think. Let me know if this doesn't return either -1 or an empty string:

:echo synIDattr(synIDtrans(hlID('Normal')), 'bg')

@pansz
Copy link
Author

pansz commented Feb 6, 2012

This returns -1 for me.

So, hi link CtrlPLinePre Ignore isn't a better approach? (I think all colors should be defined by color scheme and plugins should only use hi link)

@kien
Copy link
Owner

kien commented Feb 6, 2012

Because not every colorscheme uses guifg=bg or ctermfg=bg for Ignore (molokai for example, uses a visible color for this group's foreground). So it's better using the Normal's bg directly.

@pansz
Copy link
Author

pansz commented Feb 7, 2012

Well, it is all about choice. If a colorscheme choose to use a visible color for Ignore, then it does meant to let user see what is intend to be hidden. And if a user choose to use such a colorscheme without any modification, this means he/she choose to see the hidden text (with a dim color, of course).

When a colorscheme set ctermbg=None and use a background picture, it is impossible to hide the text completely, but the colorscheme may choose a foreground color very close to the background picture in order to make the text almost invisible, and define that group to be "Ignore".

@kien
Copy link
Owner

kien commented Feb 10, 2012

This should be fixed in 75e31e9.

It's also now possible to change the default highlighting for every part of the prompt.

@kien kien closed this as completed Feb 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants