mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 05:00:16 +00:00
Wayland: avoid replacing text with empty string (#8103)
Fix an issue where the `ime_key` is sometimes an empty string, and pressing a keystroke replaces the selected text. E.g. select some text, press `Escape`: selected text is deleted.
This commit is contained in:
parent
af06063d31
commit
946f4a312a
1 changed files with 3 additions and 1 deletions
|
@ -17,7 +17,9 @@ impl Keystroke {
|
||||||
|
|
||||||
// Ignore control characters (and DEL) for the purposes of ime_key,
|
// Ignore control characters (and DEL) for the purposes of ime_key,
|
||||||
// but if key_utf32 is 0 then assume it isn't one
|
// but if key_utf32 is 0 then assume it isn't one
|
||||||
let ime_key = (key_utf32 == 0 || (key_utf32 >= 32 && key_utf32 != 127)).then_some(key_utf8);
|
let ime_key = ((key_utf32 == 0 || (key_utf32 >= 32 && key_utf32 != 127))
|
||||||
|
&& !key_utf8.is_empty())
|
||||||
|
.then_some(key_utf8);
|
||||||
|
|
||||||
Keystroke {
|
Keystroke {
|
||||||
modifiers,
|
modifiers,
|
||||||
|
|
Loading…
Reference in a new issue