From a366cf2926cb69692cd3b97f90d2755b5145d54f Mon Sep 17 00:00:00 2001 From: Steven Xu Date: Sun, 23 Apr 2023 21:30:28 +1000 Subject: [PATCH] feat: add `current_insertion_point()` to return the current insertion point of the input buffer (#573) --- src/engine.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/engine.rs b/src/engine.rs index 08cf5c1..5e2b499 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -510,6 +510,11 @@ impl Reedline { result } + /// Returns the current insertion point of the input buffer. + pub fn current_insertion_point(&self) -> usize { + self.editor.insertion_point() + } + /// Returns the current contents of the input buffer. pub fn current_buffer_contents(&self) -> &str { self.editor.get_buffer()