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:
parent
e1d28ff957
commit
fd64ee1bb6
2 changed files with 45 additions and 2 deletions
|
@ -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",
|
||||
}
|
||||
},
|
||||
]
|
||||
"#,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue