diff options
author | Bob | 2022-07-18 01:17:13 +0000 |
---|---|---|
committer | GitHub | 2022-07-18 01:17:13 +0000 |
commit | e5c7aaed91c0b3d533a04840fedb88ecabc8f6a8 (patch) | |
tree | 7b615802e6a9a49faa58e34cf43db3fa7a0606f0 /helix-term/src/ui/prompt.rs | |
parent | 55b45ec4a4cb958b241a93cc7c3f4e499379890e (diff) |
support prefilling prompt (#2459)
* support prefilling prompt
* introduce with_line builder method in Prompt
* extract show_prompt
* use textobject_word as fallback input
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 } |