Skip to content

Commit

Permalink
Add method Interface::buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
murarth committed Jun 27, 2018
1 parent 8b125e2 commit 923498d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ impl<Term: Terminal> Interface<Term> {
///
/// If the write lock is already held, the method will block until it is released.
impl<Term: Terminal> Interface<Term> {
/// Returns the current input buffer.
pub fn buffer(&self) -> String {
self.lock_write().buffer.to_owned()
}

/// Returns the current number of history entries.
pub fn history_len(&self) -> usize {
self.lock_write().history_len()
Expand Down

0 comments on commit 923498d

Please sign in to comment.