mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-11-30 00:35:26 +03:00
Fix crash if pressing enter when nothing selected in completion.
This commit is contained in:
parent
8657c57cf2
commit
350081a3af
@ -140,7 +140,9 @@ impl<T> Component for Menu<T> {
|
||||
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;
|
||||
}
|
||||
// KeyEvent {
|
||||
|
Loading…
Reference in New Issue
Block a user