keymap ui: Fix remove key mapping bug (#34683)

Release Notes:

- N/A

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
This commit is contained in:
Anthony Eid 2025-07-18 14:09:28 -04:00 committed by GitHub
parent e1d28ff957
commit fd64ee1bb6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 45 additions and 2 deletions

View file

@ -1623,4 +1623,44 @@ mod tests {
.unindent(),
);
}
#[test]
fn test_keymap_remove() {
zlog::init_test();
check_keymap_update(
r#"
[
{
"context": "Editor",
"bindings": {
"cmd-k cmd-u": "editor::ConvertToUpperCase",
"cmd-k cmd-l": "editor::ConvertToLowerCase",
"cmd-[": "pane::GoBack",
}
},
]
"#,
KeybindUpdateOperation::Remove {
target: KeybindUpdateTarget {
context: Some("Editor"),
keystrokes: &parse_keystrokes("cmd-k cmd-l"),
action_name: "editor::ConvertToLowerCase",
action_arguments: None,
},
target_keybind_source: KeybindSource::User,
},
r#"
[
{
"context": "Editor",
"bindings": {
"cmd-k cmd-u": "editor::ConvertToUpperCase",
"cmd-[": "pane::GoBack",
}
},
]
"#,
);
}
}