junegunn / limelight.vim

:flashlight: All the world's indeed a stage and we are merely players
MIT License
2.36k stars 53 forks source link

Allow limelight to work with transparent backgrounds #67

Closed gingkapls closed 3 years ago

gingkapls commented 3 years ago

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 isn't the most elegant solution, but it allows limelight to work in transparent terminals, and still leaves room for changing the brightness of concealed text.

In the future we could run a check to see if ctermbg for Normal is none and then set dim bg to 0, but I'm not that experienced with vimscript yet.