diff options
author | gibbz00 | 2023-05-29 20:22:15 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2023-06-07 01:11:13 +0000 |
commit | 3a0892f793a0dbf1f99f5b7e6fb23cdff68fb519 (patch) | |
tree | f0ae6de443d0038b6f1e44d02be48e7fe7701bc7 | |
parent | 39773e48d32edd76d98b7b25224db2b6d24937be (diff) |
Exclude config no_op bindings in command palette.
-rw-r--r-- | helix-term/src/keymap.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs index f5626ee8..b5f71135 100644 --- a/helix-term/src/keymap.rs +++ b/helix-term/src/keymap.rs @@ -255,15 +255,12 @@ impl Keymap { // recursively visit all nodes in keymap fn map_node(cmd_map: &mut ReverseKeymap, node: &KeyTrie, keys: &mut Vec<KeyEvent>) { match node { - KeyTrie::MappableCommand(cmd) => match cmd { - MappableCommand::Typable { name, .. } => { + KeyTrie::MappableCommand(cmd) => { + let name = cmd.name(); + if name != "no_op" { cmd_map.entry(name.into()).or_default().push(keys.clone()) } - MappableCommand::Static { name, .. } => cmd_map - .entry(name.to_string()) - .or_default() - .push(keys.clone()), - }, + } KeyTrie::Node(next) => { for (key, trie) in &next.map { keys.push(*key); |