Skip to content

Commit

Permalink
fix(ui): disable backdrop when Neovim is transparent
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Mar 28, 2024
1 parent ba58b87 commit 0ccf031
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/lazy/view/float.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ function M:mount()
self.buf = vim.api.nvim_create_buf(false, true)
end

if self.opts.backdrop and self.opts.backdrop < 100 and vim.o.termguicolors then
local normal = vim.api.nvim_get_hl(0, { name = "Normal" })
local has_bg = normal and normal.bg ~= nil

if has_bg and self.opts.backdrop and self.opts.backdrop < 100 and vim.o.termguicolors then
self.backdrop_buf = vim.api.nvim_create_buf(false, true)
self.backdrop_win = vim.api.nvim_open_win(self.backdrop_buf, false, {
relative = "editor",
Expand Down

0 comments on commit 0ccf031

Please sign in to comment.