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 36ee62c3..6e7df907 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -84,6 +84,13 @@ impl Prompt { } } + pub fn with_line(mut self, line: String) -> Self { + let cursor = line.len(); + self.line = line; + self.cursor = cursor; + self + } + pub fn line(&self) -> &String { &self.line } |