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

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

Open
Frederick888 opened this issue Jan 20, 2023 · 0 comments · May be fixed by #75
Open

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

Frederick888 opened this issue Jan 20, 2023 · 0 comments · May be fixed by #75

Comments

@Frederick888
Copy link
Contributor

Neovim version

NVIM v0.8.2
Build type: Release
LuaJIT 2.1.0-beta3

Configuration

local Hydra = require('hydra')

Hydra({
  name = 'Split movements',
  mode = 'n',
  body = '<C-w>',
  config = {
    hint = {
      type = 'statusline',
    },
    timeout = 250,
  },
  heads = {
    { 'h', [[<cmd>try | wincmd h | catch /^Vim\%((\a\+)\)\=:E11:/ | close | endtry<CR>]] },
    { 'j', [[<cmd>try | wincmd j | catch /^Vim\%((\a\+)\)\=:E11:/ | close | endtry<CR>]] },
    { 'k', [[<cmd>try | wincmd k | catch /^Vim\%((\a\+)\)\=:E11:/ | close | endtry<CR>]] },
    { 'l', [[<cmd>try | wincmd l | catch /^Vim\%((\a\+)\)\=:E11:/ | close | endtry<CR>]] },
  },
})

Steps to reproduce

  1. Open any file
  2. C-w s to split window
  3. :colorscheme default
  4. C-w j
  5. Can see error below:
E5108: Error executing lua: ...rick/.vim/plugged/hydra.nvim/lua/hydra/lib/highlight.lua:16: invalid key:
stack traceback:
        [C]: in function 'nvim_set_hl'
        ...rick/.vim/plugged/hydra.nvim/lua/hydra/lib/highlight.lua:16: in main chunk
        [C]: in function 'require'
        ...ck/.vim/plugged/hydra.nvim/lua/hydra/hint/statusline.lua:18: in function '_make_statusline'
        ...ck/.vim/plugged/hydra.nvim/lua/hydra/hint/statusline.lua:38: in function 'show'
        /home/frederick/.vim/plugged/hydra.nvim/lua/hydra/init.lua:451: in function '_enter'
        /home/frederick/.vim/plugged/hydra.nvim/lua/hydra/init.lua:315: in function </home/frederick/.vim/plugged/hydra.nvim/lua/hydra/init.lua:314>

Other info

I added a print(name, vim.inspect(settings)) line right above highlight.lua:16, and the output was:

HydraStatusLineRed {
  [true] = 6,
  background = 3815994,
  foreground = 11503575
}
@Frederick888 Frederick888 linked a pull request Feb 11, 2023 that will close this issue
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 a pull request may close this issue.

1 participant