feat: implement y/Y yank

This commit is contained in:
graelo 2020-06-01 10:33:48 +02:00
parent 372781e231
commit 31e0d5cc9e

View file

@ -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.