Add a check to work with transparent themes #71
Add a check to work with transparent themes #71notginned wants to merge 5 commits intojunegunn:masterfrom
Conversation
Now both transparent and non-transparent themes work properly
|
approved |
Add LICENSE
Commits changes requested in junegunn#71 (comment)
junegunn
left a comment
There was a problem hiding this comment.
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, |
| 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.
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.