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(mappings): allowing passing desc to mappings #2892

Merged
merged 2 commits into from
Jan 27, 2024
Merged

Conversation

jamestrew
Copy link
Contributor

Currently the map function in attach_mappings doesn't respect the desc option for vim.keymap.set which we use under the hood.
This results in anonymous functions to show up nameless, as <anonymous>, in which-key regardless of whether a desc is passed.

attach_mappings = function(_, map)
    map("i", "<C-f>", function() print("im anonymous") end, { desc = "hi" }) -- shows up as anonymous
end

closes #2888

@Conni2461
Copy link
Member

Yeah makes sense thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-0.1.x PR to be backported to 0.1.x (Neovim 0.7 compat)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow setting description for anonymous functions
2 participants