-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add a check to work with transparent themes #71
base: master
Are you sure you want to change the base?
Conversation
Now both transparent and non-transparent themes work properly
approved |
Add LICENSE
Commits changes requested in junegunn#71 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which color scheme should I test this with?
I tested this with a modified base16-vim scheme where I had replaced the You can use any color scheme, and run |
Getting this error:
|
Fixes calculating the bg for `Normal` highlight group depending on the ctermbg value
Oh, I'm so sorry! This time I tried it on barebones vim, you can select the Also, I noticed that that Limelight was not able to calculate the dim coefficient with the ternary operator patch. Tweaking the logic fixed that for me so I pushed that to master. |
I don't think the patch is correct. After applying your patch, Limelight stops working with any of my color schemes. (e.g. seoul256, Tomorrow, etc.)
Note that I'm using |
Hmm, |
@@ -138,7 +138,7 @@ function! s:dim(coeff) | |||
let synid = synIDtrans(hlID('Normal')) | |||
let fg = synIDattr(synid, 'fg#') | |||
let bg = synIDattr(synid, 'bg#') | |||
let bg = bg == 'none' ? 0 : bg | |||
let bg = bg == 'none' ? bg : 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change doesn't make sense to me. Why are we discarding a validbg
value and only keeping none
?
Right now limelight throws an error about not being able to calculate bg color because of ctermbg value of Normal highlight group being set to none to allow transparency in terminals. Setting the bg value for dim coefficient to 0 solves this.
This PR adds a check to see if ctermbg is set to none (used in themes with transparent backgrounds) and changes the bg value of dim coefficient to 0 as a fix, otherwise the plugin works as before.