Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/ui/prompt.rs')
-rw-r--r--helix-term/src/ui/prompt.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs
index 8e889618..3518ddf7 100644
--- a/helix-term/src/ui/prompt.rs
+++ b/helix-term/src/ui/prompt.rs
@@ -92,6 +92,12 @@ impl Prompt {
}
}
+ /// Gets the byte index in the input representing the current cursor location.
+ #[inline]
+ pub(crate) fn position(&self) -> usize {
+ self.cursor
+ }
+
pub fn with_line(mut self, line: String, editor: &Editor) -> Self {
self.set_line(line, editor);
self