mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
repl: Ensure that the output's computed line height is at least 1 (#14877)
This commit is contained in:
parent
6dfb0a4a70
commit
781633fb1a
@ -553,9 +553,10 @@ impl LineHeight for ExecutionView {
|
||||
self.outputs
|
||||
.iter()
|
||||
.map(|output| output.num_lines(cx))
|
||||
.fold(0, |acc, additional_height| {
|
||||
.fold(0_u8, |acc, additional_height| {
|
||||
acc.saturating_add(additional_height)
|
||||
})
|
||||
.max(1)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ impl TerminalOutput {
|
||||
|
||||
impl LineHeight for TerminalOutput {
|
||||
fn num_lines(&self, _cx: &mut WindowContext) -> u8 {
|
||||
self.handler.buffer.lines().count() as u8
|
||||
self.handler.buffer.lines().count().max(1) as u8
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user