which-key.nvim icon indicating copy to clipboard operation
which-key.nvim copied to clipboard

bug: does not work with cutlass.nvim

Open kevintraver opened this issue 1 year ago • 3 comments

Did you check docs and existing issues?

  • [X] I have read all the which-key.nvim docs
  • [X] I have searched the existing issues of which-key.nvim
  • [X] I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.9.1

Operating system/version

MacOS 13

Describe the bug

Does not work with cutlass.nvim

https://github.com/gbprod/cutlass.nvim/issues/20

Steps To Reproduce

Install which-key.

Then pressing any pending operator mode keys should bring up which-key:

c, C, s, S, d, D, x, X, y

Expected Behavior

The which-key panel does not show up.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
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)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
    "gbprod/cutlass.nvim",
    config = function()
      require("cutlass").setup()
    end,
  },
  { "folke/which-key.nvim", config = true },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

kevintraver avatar Sep 09 '23 23:09 kevintraver

Related to this, for me cutlass doesn't work at all if the which-key plugin is also enabled. The pop-ups of which-key show up, but the d and s bindings are just not set by cutlass. Seems like an ordering issue to me.

sebastianst avatar Sep 11 '23 09:09 sebastianst

I think I found a workaround by setting the triggers_blacklist option of which-key to something like

triggers_blacklist = {
            -- list of mode / prefixes that should never be hooked by WhichKey
            -- this is mostly relevant for keymaps that start with a native binding
            i = { "j", "k", "d", "D", "s", "S" },
            v = { "j", "k", "d", "D", "s", "S", " ", "g" },
            n = { "d", "D", "s", "S", "m" },
        }

sebastianst avatar Sep 11 '23 10:09 sebastianst

I've tried many things to fix this but nothing works :sweat:

gbprod avatar Oct 19 '23 15:10 gbprod

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jul 06 '24 01:07 github-actions[bot]