diff options
Diffstat (limited to 'helix-term/src/ui/prompt.rs')
-rw-r--r-- | helix-term/src/ui/prompt.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index c3402f02..4daa33e5 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -19,7 +19,7 @@ pub type Completion = (RangeFrom<usize>, Cow<'static, str>); pub struct Prompt { prompt: Cow<'static, str>, - pub line: String, + line: String, cursor: usize, completion: Vec<Completion>, selection: Option<usize>, @@ -77,6 +77,10 @@ impl Prompt { } } + pub fn line(&self) -> &String { + &self.line + } + pub fn recalculate_completion(&mut self, editor: &Editor) { self.completion = (self.completion_fn)(editor, &self.line); } |