mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-26 02:37:05 +00:00
Don't dispatch keydown event if editor is still composing
This commit is contained in:
parent
97ce3998ec
commit
509f54bf20
1 changed files with 9 additions and 1 deletions
|
@ -725,7 +725,15 @@ extern "C" fn handle_key_equivalent(this: &Object, _: Sel, native_event: id) ->
|
|||
if let Some(event) = window_state_borrow.pending_key_down_event.take() {
|
||||
if let Some(mut callback) = window_state_borrow.event_callback.take() {
|
||||
drop(window_state_borrow);
|
||||
|
||||
let is_composing =
|
||||
with_input_handler(this, |input_handler| input_handler.marked_text_range())
|
||||
.flatten()
|
||||
.is_some();
|
||||
if !is_composing {
|
||||
callback(Event::KeyDown(event));
|
||||
}
|
||||
|
||||
window_state.borrow_mut().event_callback = Some(callback);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue