Skip to content

fix(lib/highlight): Ignore invalid highlight keys#75

Open
Frederick888 wants to merge 1 commit intoanuvyklack:masterfrom
Frederick888:ignore-invalid-hl-key
Open

fix(lib/highlight): Ignore invalid highlight keys#75
Frederick888 wants to merge 1 commit intoanuvyklack:masterfrom
Frederick888:ignore-invalid-hl-key

Conversation

@Frederick888
Copy link
Copy Markdown
Contributor

@Frederick888 Frederick888 commented Feb 11, 2023

3e0c066 fix(lib/highlight): Ignore invalid highlight keys

If a user sets colour scheme to default after Neovim starts,
nvim_get_hl_by_name('HydraRed', true) returns { [true] = 6 }. This
causes an 'invalid key' error later when it's used in nvim_set_hl().

It is quite a rare case, and it should be fine as long as we can avoid
the error, so that Hydra still functions.

Fixes #70

If a user sets colour scheme to default after Neovim starts,
nvim_get_hl_by_name('HydraRed', true) returns { [true] = 6 }. This
causes an 'invalid key' error later when it's used in nvim_set_hl().

It is quite a rare case, and it should be fine as long as we can avoid
the error, so that Hydra still functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error invalid key in function nvim_set_hl at hydra.nvim/lua/hydra/lib/highlight.lua:16

1 participant