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

Fix mapping when right-hand side is nil #323

Merged
merged 1 commit into from
Sep 3, 2022

Conversation

xaviervalarino
Copy link
Contributor

When a keymap has ! on the left-hand side and an anonymous function on the right-hand side, mapargs returns a table with no rhs, which breaks the test against cmd. This only seems to be an issue for this specific lhs value.

This PR is a simple fix: it checks to make sure rhs exists before testing against cmd.

Only seems to occur with '!' on the left-hand side
@xaviervalarino xaviervalarino changed the title Fix mapping when right-hand side is nil Fix mapping when right-hand side is nil #324 Sep 1, 2022
@xaviervalarino xaviervalarino changed the title Fix mapping when right-hand side is nil #324 Fix mapping when right-hand side is nil Sep 1, 2022
@Allaman
Copy link

Allaman commented Sep 2, 2022

AS a workaround until this is merged as Neovim is pretty much not usable without which-key:
Clone the repo and fix the line locally. With Packer you can load local plugins as well, e.g. use({ "~/workspace/github.com/which-key.nvim", config = get_config("which-key") })

@folke folke merged commit 1d449d4 into folke:main Sep 3, 2022
njhoffman pushed a commit to njhoffman/which-key.nvim that referenced this pull request Jan 23, 2024
Only seems to occur with '!' on the left-hand side
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 this pull request may close these issues.

3 participants