windows: Fix panic when deleting the last pre-edit char using Pinyin IME (#32442)

Release Notes:

- N/A
This commit is contained in:
张小白
2025-06-10 09:51:12 +00:00
committed by GitHub
parent 16853acbb1
commit 2dad48d8d9
+1 -1
View File
@@ -702,7 +702,7 @@ fn handle_ime_composition_inner(
} else {
if lparam & GCS_COMPSTR.0 > 0 {
let comp_string = parse_ime_composition_string(ctx, GCS_COMPSTR)?;
let caret_pos = (lparam & GCS_CURSORPOS.0 > 0).then(|| {
let caret_pos = (!comp_string.is_empty() && lparam & GCS_CURSORPOS.0 > 0).then(|| {
let pos = retrieve_composition_cursor_position(ctx);
pos..pos
});