Finished refactor for mutable terminal and long-single-lock style. Currently terminal is deadlocking instantly, need to just do the full refactor
This commit is contained in:
parent
be4873b92b
commit
bc2c8e0e05
4 changed files with 124 additions and 101 deletions
|
@ -43,8 +43,9 @@ impl<'a> TerminalTestContext<'a> {
|
|||
});
|
||||
|
||||
connection
|
||||
.condition(self.cx, |conn, cx| {
|
||||
let content = Self::grid_as_str(conn);
|
||||
.condition(self.cx, |term, cx| {
|
||||
let content = Self::grid_as_str(term);
|
||||
|
||||
f(content, cx)
|
||||
})
|
||||
.await;
|
||||
|
@ -132,14 +133,14 @@ impl<'a> TerminalTestContext<'a> {
|
|||
}
|
||||
|
||||
fn grid_as_str(connection: &Terminal) -> String {
|
||||
connection.render_lock(None, |content, _| {
|
||||
let lines = content.display_iter.group_by(|i| i.point.line.0);
|
||||
lines
|
||||
.into_iter()
|
||||
.map(|(_, line)| line.map(|i| i.c).collect::<String>())
|
||||
.collect::<Vec<String>>()
|
||||
.join("\n")
|
||||
})
|
||||
let content = connection.grid();
|
||||
|
||||
let lines = content.display_iter().group_by(|i| i.point.line.0);
|
||||
lines
|
||||
.into_iter()
|
||||
.map(|(_, line)| line.map(|i| i.c).collect::<String>())
|
||||
.collect::<Vec<String>>()
|
||||
.join("\n")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue