nvimtools / hydra.nvim

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

`hide_on_load` breaks previous setting `hint = false` #30

Closed b0ae989c closed 8 months ago

b0ae989c commented 8 months ago

This is a bug since commit 0c6dee1d10b8cd701cbc1e2c1031b9365c660764.

Source: https://github.com/nvimtools/hydra.nvim/blob/0c6dee1d10b8cd701cbc1e2c1031b9365c660764/lua/hydra/init.lua#L389

miversen33 commented 8 months ago

Can you provide a replication hydra config for this?

b0ae989c commented 8 months ago

Sure. Here is a minial init.lua

local root = vim.fn.fnamemodify('./.repro', ':p')
for _, name in ipairs({ 'config', 'data', 'state', 'cache' }) do
  vim.env[('XDG_%s_HOME'):format(name:upper())] = root .. '/' .. name
end
local lazypath = root .. '/plugins/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    'git',
    'clone',
    '--filter=blob:none',
    'https://github.com/folke/lazy.nvim.git',
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)
local plugins = {
  'folke/tokyonight.nvim',
  {
    'https://github.com/nvimtools/hydra.nvim',
    commit = '0c6dee1d10b8cd701cbc1e2c1031b9365c660764',
    config = function()
      local hydra = require('hydra')
      hydra({
        name = 'Side scroll',
        mode = 'n',
        body = 'z',
        heads = {
          { 'h', '5zh' },
          { 'l', '5zl', { desc = '←/→' } },
          { 'H', 'zH' },
          { 'L', 'zL', { desc = 'half screen ←/→' } },
        },
        config = { hint = false },
      })
    end,
  },
}
require('lazy').setup(plugins, { root = root .. '/plugins' })
vim.cmd.colorscheme('tokyonight')
miversen33 commented 8 months ago

I'll check on this tomorrow. Thank you!

miversen33 commented 8 months ago

For the sake of future Mike's sanity, please also include a bit of detail about "breaks". Are you getting a crash? Undesirable behavior? Etc, so I know what to look for when I start digging into this

b0ae989c commented 8 months ago

Got it. For this issue, we will get an error message saying

attempt to index field 'hint' (a boolean value)

and the plugin fails to load.