Skip to content

command_palette: Fix keymap editor not matching actions with underscored namespaces#50415

Merged
probably-neb merged 1 commit intozed-industries:mainfrom
davidalecrim1:fix/keymap-editor-underscore-action-matching
Mar 31, 2026
Merged

command_palette: Fix keymap editor not matching actions with underscored namespaces#50415
probably-neb merged 1 commit intozed-industries:mainfrom
davidalecrim1:fix/keymap-editor-underscore-action-matching

Conversation

@davidalecrim1
Copy link
Copy Markdown
Contributor

@davidalecrim1 davidalecrim1 commented Feb 28, 2026

Closes #50223

Summary

When clicking Change Keybinding from the command palette on an action whose namespace contains underscores (e.g. terminal_panel::Toggle, project_panel::ToggleFocus), the keymap editor showed "No matches found for the provided query". Actions without underscores (e.g. zed::OpenLog) worked fine.

I opened this issue for this #50223, but took the liberty of sending a PR.

Root cause: normalize_action_query preserved underscores in the query, but the search candidates are built with humanize_action_name which converts underscores to spaces. The fuzzy matcher looked for _ in a candidate like "terminal panel: toggle" where it doesn't exist, so matching always failed.

Fix: normalize_action_query now converts underscores to spaces before the deduplication checks, consistent with humanize_action_name. This also correctly collapses consecutive underscores with adjacent spaces.

All three call sites of normalize_action_query (command palette search, keymap editor filter, action completion provider) match against humanized candidates, so the fix improves consistency across all of them.

Before (Left) / After (Right)

Screenshot 2026-02-28 at 17 56 05 Screenshot 2026-02-28 at 17 55 38

Release Notes:

  • Fixed keymap editor showing no results when opening "Change Keybinding" from the command palette for actions with underscores in their namespace (e.g. terminal_panel::Toggle, project_panel::ToggleFocus)

…red namespaces

normalize_action_query preserved underscores, but search candidates use
humanize_action_name which converts underscores to spaces. Fuzzy matching
failed because '_' never appears in humanized candidates.

Actions like terminal_panel::Toggle, project_panel::ToggleFocus, etc.
would show "No matches found" when clicking "Change Keybinding" from
the command palette.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 28, 2026
@zed-community-bot zed-community-bot bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Feb 28, 2026
@zed-industries-bot
Copy link
Copy Markdown
Contributor

Messages
📖

This PR includes links to the following GitHub Issues: #50223
If this PR aims to close an issue, please include a Closes #ISSUE line at the top of the PR body.

Generated by 🚫 dangerJS against dd442c9

@probably-neb
Copy link
Copy Markdown
Collaborator

This looks great, thanks!

@probably-neb probably-neb merged commit 88d1275 into zed-industries:main Mar 31, 2026
40 checks passed
@probably-neb
Copy link
Copy Markdown
Collaborator

@zed-zippy approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Command palette to change key bindings doesn't work with terminal commands

3 participants