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

@ -2,7 +2,7 @@ use crate::components::KernelListItem;
use crate::KernelStatus;
use crate::{
kernels::{Kernel, KernelSpecification, RunningKernel},
outputs::{ExecutionStatus, ExecutionView, LineHeight as _},
outputs::{ExecutionStatus, ExecutionView},
};
use client::telemetry::Telemetry;
use collections::{HashMap, HashSet};
@ -82,7 +82,8 @@ impl EditorBlock {
let invalidation_anchor = buffer.read(cx).read(cx).anchor_before(next_row_start);
let block = BlockProperties {
position: code_range.end,
height: (execution_view.num_lines(cx) + 1) as u32,
// Take up at least one height for status, allow the editor to determine the real height based on the content from render
height: 1,
style: BlockStyle::Sticky,
render: Self::create_output_area_renderer(execution_view.clone(), on_close.clone()),
disposition: BlockDisposition::Below,