feat: add current_insertion_point() to return the current insertion point of the input buffer (#573)

This commit is contained in:
Steven Xu 2023-04-23 21:30:28 +10:00 committed by GitHub
parent f6b23420e2
commit a366cf2926
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()