Skip to content

Commit ababa9d

Browse files
fix: Avoid grabbing invalid highlight keys (#18)
Co-authored-by: benlubas <benmlubas@gmail.com>
1 parent ef9544f commit ababa9d

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

lua/hydra/lib/highlight.lua

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
local api = vim.api
22

3-
local function get_hl(name)
4-
---@type boolean
5-
local rgb = api.nvim_get_option('termguicolors')
6-
return api.nvim_get_hl_by_name(name, rgb)
7-
end
8-
93
local name, settings
104
for _, color in ipairs({ 'Red', 'Blue', 'Amaranth', 'Teal', 'Pink' }) do
115
settings = vim.tbl_deep_extend('force',
12-
get_hl('StatusLine'),
13-
get_hl(string.format('Hydra%s', color))
6+
api.nvim_get_hl(0, { name = 'StatusLine', link = false }),
7+
api.nvim_get_hl(0, { name = string.format('Hydra%s', color), link = false })
148
)
159
name = string.format('HydraStatusLine%s', color)
1610
api.nvim_set_hl(0, name, settings)

0 commit comments

Comments
 (0)