diff options
author | Andrey Tkachenko | 2022-04-20 01:42:33 +0000 |
---|---|---|
committer | GitHub | 2022-04-20 01:42:33 +0000 |
commit | 3a7bf1c40cba7f4763df38e347587b5c3003d080 (patch) | |
tree | 3f7ab72d0667625aa5c5de4c66da54d5fd8b0b3e /helix-term/src/ui/popup.rs | |
parent | cc68fa857dced7d9433d145ebfa8cd70e5a0394d (diff) |
Restore document state on completion cancel (#2096)
Diffstat (limited to 'helix-term/src/ui/popup.rs')
-rw-r--r-- | helix-term/src/ui/popup.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/helix-term/src/ui/popup.rs b/helix-term/src/ui/popup.rs index 45527482..069a22f4 100644 --- a/helix-term/src/ui/popup.rs +++ b/helix-term/src/ui/popup.rs @@ -124,7 +124,10 @@ impl<T: Component> Component for Popup<T> { match key.into() { // esc or ctrl-c aborts the completion and closes the menu - key!(Esc) | ctrl!('c') => EventResult::Consumed(Some(close_fn)), + key!(Esc) | ctrl!('c') => { + let _ = self.contents.handle_event(event, cx); + EventResult::Consumed(Some(close_fn)) + } ctrl!('d') => { self.scroll(self.size.1 as usize / 2, true); EventResult::Consumed(None) |