nvimtools / hydra.nvim

Create custom submodes and menus
MIT License
145 stars 8 forks source link

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

Closed Frederick888 closed 10 months ago

Frederick888 commented 10 months ago

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.


This was https://github.com/anuvyklack/hydra.nvim/pull/75

benlubas commented 10 months ago

@Frederick888 I'm unable to reproduce the issue as described in the original issue you linked, but I didn't have to do any of the key checks that you had to do (b/c we're using the new api)

Can you make sure that this branch works and then I can go ahead and merge this

Frederick888 commented 10 months ago

@benlubas Yes, I can confirm this branch works. Thank you.