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

bug: visual mode keymap `<CR>` not shown in which-key

Open tummetott opened this issue 1 year ago • 1 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.4 Build type: Release LuaJIT 2.1.1696795921

Operating system/version

MacOs 13.4.1

Describe the bug

When registering <CR> as keymap in visual mode, the keymap description is not shown in which-key

Steps To Reproduce

  1. Run the repro.lua: nvim --clean -u repro.lua
  2. Type v and wait for the keymap description window to show

Expected Behavior

Keymap description for <CR> is shown in the which-key window

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",
    { 'folke/which-key.nvim', opts = {} },
}
require("lazy").setup(plugins, {
    root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")

require 'which-key'.register({
    ['<CR>'] = { function() print('hallo') end, 'some description' },
}, { mode = 'v' })

tummetott avatar Nov 10 '23 11:11 tummetott

I am facing the same issue trying to register visual/select keymap. Has this issue been resolved by any chance?

ddkasa avatar Jan 01 '24 16:01 ddkasa

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]