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
|
Status::Active
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let key_press = KeyPress {
|
||||||
|
key,
|
||||||
|
modifiers,
|
||||||
|
text,
|
||||||
|
status,
|
||||||
|
};
|
||||||
|
|
||||||
if let Some(key_binding) = key_binding {
|
if let Some(key_binding) = key_binding {
|
||||||
key_binding(KeyPress {
|
key_binding(key_press)
|
||||||
key,
|
|
||||||
modifiers,
|
|
||||||
text,
|
|
||||||
status,
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
Binding::from_key_press(KeyPress {
|
Binding::from_key_press(key_press)
|
||||||
key,
|
|
||||||
modifiers,
|
|
||||||
text,
|
|
||||||
status,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
.map(Self::Binding)
|
.map(Self::Binding)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue