diff options
-rw-r--r-- | widget/src/text_editor.rs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index fa7863da..56fb7578 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -1017,20 +1017,17 @@ impl<Message> Update<Message> { Status::Active }; + let key_press = KeyPress { + key, + modifiers, + text, + status, + }; + if let Some(key_binding) = key_binding { - key_binding(KeyPress { - key, - modifiers, - text, - status, - }) + key_binding(key_press) } else { - Binding::from_key_press(KeyPress { - key, - modifiers, - text, - status, - }) + Binding::from_key_press(key_press) } .map(Self::Binding) } |