repl: Rely on block decorations to size according to content (#15713)

We no longer have to use line height calculations now that
https://github.com/zed-industries/zed/pull/15536 is in. Blocks resize
according to their content. This fixes up some of the rendering issues
on plaintext outputs as well.

Release Notes:

- Fix repl plain text output wrapping around and covering editor text
(https://github.com/zed-industries/zed/issues/15491,
https://github.com/zed-industries/zed/issues/14855)
This commit is contained in:
Kyle Kelley 2024-08-02 19:15:15 -07:00 committed by GitHub
parent 5c54596027
commit b6a3556a32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 90 deletions

View file

@ -1,4 +1,4 @@
use crate::outputs::{ExecutionView, LineHeight};
use crate::outputs::ExecutionView;
use alacritty_terminal::vte::{
ansi::{Attr, Color, NamedColor, Rgb},
Params, ParamsIter, Parser, Perform,
@ -7,7 +7,7 @@ use core::iter;
use gpui::{font, prelude::*, AnyElement, StyledText, TextRun};
use settings::Settings as _;
use theme::ThemeSettings;
use ui::{div, prelude::*, IntoElement, ViewContext, WindowContext};
use ui::{div, prelude::*, IntoElement, ViewContext};
/// Implements the most basic of terminal output for use by Jupyter outputs
/// whether:
@ -95,12 +95,6 @@ impl TerminalOutput {
}
}
impl LineHeight for TerminalOutput {
fn num_lines(&self, _cx: &mut WindowContext) -> usize {
self.handler.buffer.lines().count().max(1)
}
}
#[derive(Clone, Default)]
struct AnsiTextRun {
len: usize,