mirror of https://github.com/helix-editor/helix
Fix crash if pressing enter when nothing selected in completion.
parent
8657c57cf2
commit
350081a3af
|
@ -140,7 +140,9 @@ impl<T> Component for Menu<T> {
|
||||||
code: KeyCode::Enter,
|
code: KeyCode::Enter,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
(self.callback_fn)(cx.editor, self.selection(), MenuEvent::Validate);
|
if let Some(selection) = self.selection() {
|
||||||
|
(self.callback_fn)(cx.editor, Some(selection), MenuEvent::Validate);
|
||||||
|
}
|
||||||
return close_fn;
|
return close_fn;
|
||||||
}
|
}
|
||||||
// KeyEvent {
|
// KeyEvent {
|
||||||
|
|
Loading…
Reference in New Issue