🪴 a tiny, customizable statusline for neovim
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(utils): allow passing hl sets to reverse hl helper

robin 3c5d7d90 26116269

+8 -4
+8 -4
lua/lylla/utils.lua
··· 99 99 end) 100 100 end 101 101 102 - ---@param hl_name string 102 + ---@param hl string|vim.api.keyset.highlight name or keyset 103 103 ---@return vim.api.keyset.highlight 104 - function utils.reverse_hl(hl_name) 105 - local hl = vim.api.nvim_get_hl(0, { name = hl_name }) 104 + function utils.reverse_hl(hl) 105 + if type(hl) == "string" then 106 + ---@diagnostic disable-next-line: cast-local-type 107 + hl = vim.api.nvim_get_hl(0, { name = hl }) 108 + end 109 + 106 110 if vim.tbl_isempty(hl) or (not hl.fg and not hl.bg and not hl.link) then 107 111 return {} 108 112 end 109 113 if hl.link then 110 - return utils.reverse_hl(hl.link) 114 + return utils.reverse_hl(hl.link --[[@as string]]) 111 115 end 112 116 local rev = vim.deepcopy(hl) 113 117 rev.fg = hl.bg