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

Release Notes:

- N/A
This commit is contained in:
张小白
2025-07-10 01:15:33 +00:00
committed by GitHub
parent 08ffd9884a
commit a133c1311d
+3 -1
View File
@@ -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())
}
}
}