Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Frederick888
Copy link
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