windows: Let IME early return in vim mode (#11551)

This PR follows up #11387 , slightly changes the IME window behavior to
match macOS implementation.

Release Notes:

- N/A
This commit is contained in:
张小白 2024-05-09 02:01:48 +08:00 committed by GitHub
parent 5103995c32
commit 4b98c35d68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -585,7 +585,10 @@ fn handle_ime_position(handle: HWND, state_ptr: Rc<WindowsWindowStatePtr>) -> Op
let scale_factor = lock.scale_factor;
drop(lock);
let caret_range = input_handler.selected_text_range().unwrap_or_default();
let Some(caret_range) = input_handler.selected_text_range() else {
state_ptr.state.borrow_mut().input_handler = Some(input_handler);
return Some(0);
};
let caret_position = input_handler.bounds_for_range(caret_range).unwrap();
state_ptr.state.borrow_mut().input_handler = Some(input_handler);
let config = CANDIDATEFORM {