Skip to content

Commit

Permalink
fix: better check for empty highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 15, 2022
1 parent 3e6bc74 commit a2784f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/noice/config/highlights.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ M.defaults = {
function M.setup()
for hl, link in pairs(M.defaults) do
local ok, opts = pcall(vim.api.nvim_get_hl_by_name, link, true)
if not ok then
if opts then
opts[vim.type_idx] = nil
end
if not ok or vim.tbl_isempty(opts) then
opts = { link = link }
end
opts.default = true
Expand Down

0 comments on commit a2784f1

Please sign in to comment.