Skip to content

Commit

Permalink
fix(highlights): handle winbar group not found
Browse files Browse the repository at this point in the history
See #177
  • Loading branch information
rcarriga committed Nov 19, 2022
1 parent f9f8520 commit aec0163
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/dapui/config/highlights.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ local control_hl_groups = {
---@param template_group string Name of highlight group
---@return nil
function M.patch_background(template_group)
local guibg = vim.api.nvim_get_hl_by_name(template_group, true).background
-- Only exists for >= 0.8
local exists, hl = pcall(vim.api.nvim_get_hl_by_name, template_group, true)
if not exists then
return
end

local guibg = hl.background
for _, hl_group in ipairs(control_hl_groups) do
vim.cmd {
cmd = "highlight",
Expand Down

0 comments on commit aec0163

Please sign in to comment.