nvimtools / hydra.nvim

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

Any colored hydra fails due to authentication error. #49

Open matu3ba opened 2 days ago

matu3ba commented 2 days ago

Might be neovim regression and/or breaking change, see https://neovim.io/doc/user/news.html:

LUA
API functions now consistently return an empty dictionary as [vim.empty_dict()](https://neovim.io/doc/user/lua.html#vim.empty_dict()). Earlier, a [lua-special-tbl](https://neovim.io/doc/user/lua.html#lua-special-tbl) was sometimes used.
$ nvim --version
NVIM v0.11.0-dev-789+g0ba388847
Build type: RelWithDebInfo
LuaJIT 2.1.1724512491
Run "nvim -V1 -v" for more info

Minimal reproduction inspired by gitsigns bug tracker:

for name, url in pairs{
  hydralink = 'https://github.com/nvimtools/hydra.nvim',
} do
  local install_path = vim.fn.fnamemodify('hydra_issue/'..name, ':p')
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
  vim.opt.runtimepath:append(install_path)
end

local Hydra = require('hydra')

-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE

Hydra {
  name = 'Side scroll',
  config = {
    color = 'pink', -- without color pink it works
    -- invoke_on_body = true, -- does not matter if inside or not.
  },
  mode = 'n',
  body = 'z',
  heads = {
    { 'h', '5zh' },
    { 'l', '5zl', { desc = '←/→' } },
    { 'H', 'zH' },
    { 'L', 'zL', { desc = 'half screen ←/→' } },
  },
}

Error:

Fehler beim Ausführen von "/home/misterspoon/dev/try/trylua/minhydra.lua":
E5113: Error while calling lua chunk: vim/shared.lua:0: s: expected string, got number (1)
stack traceback:
        [C]: in function 'error'
        vim/shared.lua: in function 'validate'
        vim/shared.lua: in function 'startswith'
        vim/_init_packages.lua: in function '__index'
        vim/shared.lua: in function 'islist'
        vim/shared.lua: in function ''
        vim/shared.lua: in function 'tbl_deep_extend'
        ...y/trylua/hydra_issue/hydralink//lua/hydra/layer/init.lua:116: in function 'initialize'
        ...ry/trylua/hydra_issue/hydralink//lua/hydra/lib/class.lua:14: in function 'Layer'
        ...dev/try/trylua/hydra_issue/hydralink//lua/hydra/init.lua:440: in function '_setup_pink_hydra'
        ...dev/try/trylua/hydra_issue/hydralink//lua/hydra/init.lua:282: in function 'initialize'
        ...ry/trylua/hydra_issue/hydralink//lua/hydra/lib/class.lua:14: in function 'Hydra'
        /home/misterspoon/dev/try/trylua/minhydra.lua:15: in main chunk
miversen33 commented 2 days ago

Please provide the version of neovim you are running.

This smells like nightly, in which case, see #47 for details on why we aren't addressing these issues yet.

matu3ba commented 2 days ago

I have edited the issue text to include the version information and yes, that is on nightly.

miversen33 commented 2 days ago

Thanks :) Ya for the time being we are not addressing nightly issues. At least not until the vim.table work is stabilized.