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:
Smit Barmase 2025-06-11 14:16:21 +05:30 committed by GitHub
parent 0852912fd6
commit 6d9bcdb2af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
}