From 002f1ad397a6fff4fec044e05a8784c643a04d48 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Sat, 12 Jun 2021 18:46:05 +0800 Subject: Add filter ability to picker Inspired by doom emacs. Able to filter picker options multiple times. --- helix-term/src/ui/prompt.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'helix-term/src/ui/prompt.rs') diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index 433de15e..c388c315 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -106,6 +106,13 @@ impl Prompt { self.exit_selection(); } + pub fn clear(&mut self) { + self.line.clear(); + self.cursor = 0; + self.completion = (self.completion_fn)(&self.line); + self.exit_selection(); + } + pub fn change_completion_selection(&mut self, direction: CompletionDirection) { if self.completion.is_empty() { return; -- cgit v1.2.3-70-g09d2