@@ -1053,7 +1053,8 @@ impl Stream {
|
|||||||
file_stream.stream.get_mut().file.seek(SeekFrom::Start(0)).unwrap();
|
file_stream.stream.get_mut().file.seek(SeekFrom::Start(0)).unwrap();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Stream::Readline(_) => {
|
Stream::Readline(ref mut readline_stream) => {
|
||||||
|
readline_stream.reset();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
|
|||||||
@@ -111,6 +111,12 @@ impl ReadlineStream {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn reset(&mut self) {
|
||||||
|
self.pending_input.get_mut().clear();
|
||||||
|
self.pending_input.set_position(0);
|
||||||
|
}
|
||||||
|
|
||||||
fn call_readline(&mut self) -> std::io::Result<usize> {
|
fn call_readline(&mut self) -> std::io::Result<usize> {
|
||||||
match self.rl.readline(get_prompt()) {
|
match self.rl.readline(get_prompt()) {
|
||||||
Ok(text) => {
|
Ok(text) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user