Skip to content

binds/which-key: allow deregistering binds or groups #972

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lackac
Copy link
Contributor

@lackac lackac commented Jun 26, 2025

options.vim.binds.whichKey.register has type attrsOf (nullOr str), but it actually failed to build with null values. This fixes that and uses null values as a signal to not register a bind or group that was set by one of the plugins.

Sanity Checking

  • I have updated the changelog as per my changes
  • I have tested, and self-reviewed my code
  • My changes fit guidelines found in hacking nvf
  • Style and consistency
    • I ran Alejandra to format my code (nix fmt)
    • My code conforms to the editorconfig configuration of the project
    • My changes are consistent with the rest of the codebase
  • If new changes are particularly complex:
    • My code includes comments in particularly complex areas
    • I have added a section in the manual
    • (For breaking changes) I have included a migration guide
  • Package(s) built:
    • .#nix (default package)
    • .#maximal
    • .#docs-html (manual, must build)
    • .#docs-linkcheck (optional, please build if adding links)
  • Tested on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin

Add a 👍 reaction to pull requests you find important.

Copy link

github-actions bot commented Jun 26, 2025

🚀 Live preview deployed from c4d8027

View it here:

Debug Information

Triggered by: lackac

HEAD at: which-key-deregister

Reruns: 1048

@horriblename
Copy link
Collaborator

this doesn't "deregister" the group does it? just makes it a group with no description

@lackac
Copy link
Contributor Author

lackac commented Jun 30, 2025

this doesn't "deregister" the group does it? just makes it a group with no description

no, it does. It uses lib.lists.optional to omit those keys that are set to null from the actual configuration that which-key receives. There are a number of keys that are registered in the nvf config (e.g. for trouble) and they use pushDownDefault so can be overridden by setting them null by the user. The change in this PR is necessary to make that possible.

Copy link
Collaborator

@horriblename horriblename left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks!

github-actions bot pushed a commit that referenced this pull request Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants