aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/prompt.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-03-23 01:39:24 +0000
committerBlaž Hrastnik2022-03-28 02:02:26 +0000
commit92bb312f0fadc0cb60f51241a10d39783c020a3f (patch)
tree91cdbebeb66b121d7908d45f97a81427579fd6da /helix-term/src/ui/prompt.rs
parent96a4eb84838d4cbfb9313968278985ea1986a3bc (diff)
Make line a private property
Diffstat (limited to 'helix-term/src/ui/prompt.rs')
-rw-r--r--helix-term/src/ui/prompt.rs6
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);
}