Skip to content

Commit

Permalink
fix: don't add name to hl table if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
famiu committed Sep 24, 2021
1 parent 2f8d1be commit d1e4de3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/feline/generator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,18 @@ local function get_hlname(hl, parent_hl)
if hl.bg:sub(1, 1) == '#' then bg_str = hl.bg:sub(2) else bg_str = hl.bg end

-- Generate unique hl name from color strings if a name isn't provided
hl.name = hl.name or string.format(
local hlname = hl.name or string.format(
'StatusComponent_%s_%s_%s',
fg_str,
bg_str,
string.gsub(hl.style, ',', '_')
)

if not M.highlights[hl.name] then
add_hl(hl.name, hl.fg, hl.bg, hl.style)
if not M.highlights[hlname] then
add_hl(hlname, hl.fg, hl.bg, hl.style)
end

return hl.name
return hlname
end

-- Parse component seperator
Expand Down

0 comments on commit d1e4de3

Please sign in to comment.