diff options
Diffstat (limited to 'helix-term/src/ui/prompt.rs')
-rw-r--r-- | helix-term/src/ui/prompt.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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; |