mirror of
https://github.com/nushell/reedline.git
synced 2024-09-11 15:55:50 +03:00
Update to make work with new lines embedded in sent string. (#588)
* Update to make work with new lines embedded in sent string. * Appease fmt
This commit is contained in:
parent
f7515b40e5
commit
79778f7b85
@ -24,7 +24,9 @@ fn main() {
|
||||
let mut i = 1;
|
||||
loop {
|
||||
sleep(Duration::from_secs(1));
|
||||
assert!(p_clone.print(format!("Message {i} delivered.")).is_ok());
|
||||
assert!(p_clone
|
||||
.print(format!("Message {i} delivered.\nWith two lines!"))
|
||||
.is_ok());
|
||||
i += 1;
|
||||
}
|
||||
});
|
||||
|
@ -1669,7 +1669,8 @@ impl Reedline {
|
||||
let result = external_printer.receiver().try_recv();
|
||||
match result {
|
||||
Ok(line) => {
|
||||
messages.push(line);
|
||||
let lines = line.lines().map(String::from).collect::<Vec<_>>();
|
||||
messages.extend(lines);
|
||||
}
|
||||
Err(TryRecvError::Empty) => {
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user