editor: Fix certain unwanted pre-emptive keys been shown in buffer (#32528)
Closes #32456
https://github.com/zed-industries/zed/pull/32007 added showing
pre-emptive keys for multi-key bindings. But for certain keys like
"control", "backspace", "escape", "shift", "f1", etc., shouldn't be
shown as these keys would not end up in buffer after pending input
delay. This PR changes it to use just `key_char`, as it represents
actual text that will end up in buffer and is `None` for all mentioned
keys.
fad4c17c97/crates/gpui/src/platform/keystroke.rs (L14-L21)
cc @ConradIrwin
Release Notes:
- Fixed issue where triggering multi-key binding like "shift",
"control", etc. would write them to the buffer for a short time.
This commit is contained in:
parent
0852912fd6
commit
6d9bcdb2af
1 changed files with 1 additions and 1 deletions
|
@ -19742,7 +19742,7 @@ impl Editor {
|
|||
.flatten()
|
||||
.filter_map(|keystroke| {
|
||||
if keystroke.modifiers.is_subset_of(&Modifiers::shift()) {
|
||||
Some(keystroke.key_char.clone().unwrap_or(keystroke.key.clone()))
|
||||
keystroke.key_char.clone()
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue