Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

windows: Fix `ctrl-r` showing the control character (#34171)

张小白a133c1311d2e
diff --git a/crates/gpui/src/platform/windows/events.rs b/crates/gpui/src/platform/windows/events.rs
index 8b8964b2dfa..839fd10375b 100644
--- a/crates/gpui/src/platform/windows/events.rs
+++ b/crates/gpui/src/platform/windows/events.rs
@@ -1248,7 +1248,9 @@ fn parse_char_message(wparam: WPARAM, state_ptr: &Rc<WindowsWindowStatePtr>) ->
}
_ => {
lock.pending_surrogate = None;
- String::from_utf16(&[code_point]).ok()
+ char::from_u32(code_point as u32)
+ .filter(|c| !c.is_control())
+ .map(|c| c.to_string())
}
}
}