Reduce KeyPress duplication in text_editor
This commit is contained in:
parent
28d8b73846
commit
e73c8b0413
1 changed files with 9 additions and 12 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue