This is a patch by @nuko8 from #981, allowing terminal vim to clear the background when using termguicolors
https://github.com/vim/vim/pull/2332
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
You forgot to mention which problem this fixes.
@chrisbra in terminal vim when using :set termguicolors it is not possible to clear the background (allowing transparency or the terminal background to be displayed). :hi Normal guibg=NONE has no effect, so the only way to get a transparent background in a true color terminal is by not setting the guibg - which in many cases means patching colorschemes.
This patch (not written by me) allows :hi Normal guibg=NONE to clear an existing guibg highlight. See #981 for more information.
@nickspoons pushed 1 commit.
—
You are receiving this because you are subscribed to this thread.
Here's an example of an unpatched vim (above) and a patched vim (below) on black terminal backgrounds. The unpatched can't clear its guibg highlight so keeps the grey background colour which gets set in the colorscheme.

For each of these, the command :hi Normal outputs Normal xxx ctermfg=223 guifg=#ebdbb2.
@brammool the current tests pass. I don't know how to otherwise ensure that it doesn't break anything else.
Minimum steps to reproduce:
:set termguicolors:hi Normal guibg=Red:hi Normal guibg=NONEWithout this patch, the background remains red.
I have built and tested vim and gvim on Arch linux, and vim on cygwin (Windows 7)
Merging #2332 into master will increase coverage by
0.05%.
The diff coverage is71.42%.
@@ Coverage Diff @@ ## master #2332 +/- ## ========================================== + Coverage 74.42% 74.48% +0.05% ========================================== Files 90 90 Lines 132167 132174 +7 Branches 30902 29028 -1874 ========================================== + Hits 98367 98446 +79 + Misses 33775 33728 -47 + Partials 25 0 -25
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/syntax.c | 77.5% <71.42%> (+0.01%) |
⬆️ |
| src/version.c | 80.8% <0%> (ø) |
⬆️ |
| src/gui_gtk_x11.c | 47.6% <0%> (ø) |
⬆️ |
| src/ex_cmds2.c | 80.64% <0%> (+0.09%) |
⬆️ |
| src/gui.c | 47.63% <0%> (+0.15%) |
⬆️ |
| src/if_xcmdsrv.c | 84.71% <0%> (+0.17%) |
⬆️ |
| src/message.c | 68.26% <0%> (+0.19%) |
⬆️ |
| src/term.c | 50.94% <0%> (+0.21%) |
⬆️ |
| src/window.c | 81.38% <0%> (+0.52%) |
⬆️ |
| ... and 2 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered by Codecov. Last update 1dcada1...5cf8d1f. Read the comment docs.
Hey, sorry if I am reviving an old ticket, but just got to this PR after a couple of hours of debugging my vimrc using google. It seems that this PR will solve my particular problems. Do you guys know if it will get accepted any time soon? Should I just build it myself? Thanks a lot for the work you are doing, and sorry if this kind of pinging old PRs is frowned upon.
Thanks Bram 👍
Awesome! My vim looks reasonably now, not like a malnourished tiger. Thank you. Made me even make out-of-cycle build on my COPR for Fedora/RHEL.
Thanks Bram, this is great.