Skip to content

Commit ce53a09

Browse files
committed
fix: only return highlights that do highlighting
1 parent 3346244 commit ce53a09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/astroui/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ end
4444
---@param fallback? table The fallback highlight properties
4545
---@return table properties # the highlight group properties
4646
function M.get_hlgroup(name, fallback)
47-
if vim.fn.hlexists(name) == 1 then
48-
local hl = vim.api.nvim_get_hl(0, { name = name, link = false })
47+
local hl = vim.api.nvim_get_hl(0, { name = name, link = false, create = false })
48+
if not vim.tbl_isempty(hl) then
4949
if not hl.fg then hl.fg = "NONE" end
5050
if not hl.bg then hl.bg = "NONE" end
5151
if hl.reverse then

0 commit comments

Comments
 (0)