From 31e0d5cc9ea3b7aa649c1ef5634dd2ef304a82e2 Mon Sep 17 00:00:00 2001 From: graelo Date: Mon, 1 Jun 2020 10:33:48 +0200 Subject: [PATCH] feat: implement y/Y yank --- src/view.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/view.rs b/src/view.rs index de2f577..9151f68 100644 --- a/src/view.rs +++ b/src/view.rs @@ -360,6 +360,15 @@ impl<'a> View<'a> { } } + event::Key::Char(_ch @ 'y') => { + let text = self.matches.get(self.focus_index).unwrap().text; + return Event::Match((text.to_string(), false)); + } + event::Key::Char(_ch @ 'Y') => { + let text = self.matches.get(self.focus_index).unwrap().text; + return Event::Match((text.to_string(), true)); + } + // TODO: use a Trie or another data structure to determine // if the entered key belongs to a longer hint. // Attempts at finding a match with a corresponding hint.