Skip to content

Commit

Permalink
Revert "feat(hlgroups): add workaround for winbar background issue (B…
Browse files Browse the repository at this point in the history
…ekaboo#118)"

This reverts commit 98aec7c.
  • Loading branch information
liskin committed Sep 4, 2024
1 parent 8446fd8 commit b48b4b2
Showing 1 changed file with 1 addition and 38 deletions.
39 changes: 1 addition & 38 deletions lua/dropbar/hlgroups.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,48 +94,11 @@ end

---Initialize highlight groups for dropbar
local function init()
local groupid = vim.api.nvim_create_augroup('DropBarHlGroups', {})

set_hlgroups()
vim.api.nvim_create_autocmd('ColorScheme', {
group = groupid,
group = vim.api.nvim_create_augroup('DropBarHlGroups', {}),
callback = set_hlgroups,
})

-- Remove winbar background as a workaround for
-- https://github.com/Bekaboo/dropbar.nvim/issues/118, also see
-- https://github.com/neovim/neovim/issues/26037#issuecomment-1838548013

---Set WinBar & WinBarNC background to Normal background
---@return nil
local function clear_winbar_bg()
---@param name string
---@return nil
local function _clear_bg(name)
local hl = vim.api.nvim_get_hl(0, { name = name, link = false })
if hl.bg or hl.ctermbg then
hl.bg = nil
hl.ctermbg = nil
vim.api.nvim_set_hl(0, name, hl)
end
end

_clear_bg('WinBar')
_clear_bg('WinBarNC')
end

clear_winbar_bg()
vim.api.nvim_create_autocmd('ColorScheme', {
desc = 'Remove WinBar background color as a workaround.',
group = groupid,
callback = clear_winbar_bg,
})
vim.api.nvim_create_autocmd('OptionSet', {
desc = 'Remove WinBar background color as a workaround.',
pattern = 'background',
group = groupid,
callback = clear_winbar_bg,
})
end

return {
Expand Down

0 comments on commit b48b4b2

Please sign in to comment.