From 83e2889d63b5df4b390d9fff66641f2c500cbc8a Mon Sep 17 00:00:00 2001 From: Lukas Geiger Date: Wed, 30 Oct 2024 14:12:32 +0000 Subject: [PATCH] Fix notebook cell-height when soft-wrapping lines (#19933) --- crates/repl/src/notebook/cell.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/repl/src/notebook/cell.rs b/crates/repl/src/notebook/cell.rs index bb6b6fbf3865b37d7e701b64fe9fe00a5a5c49cd..f86f969a96323fd5147f9602c97091807bc21967 100644 --- a/crates/repl/src/notebook/cell.rs +++ b/crates/repl/src/notebook/cell.rs @@ -553,9 +553,6 @@ impl RunnableCell for CodeCell { impl Render for CodeCell { fn render(&mut self, cx: &mut ViewContext) -> impl IntoElement { - let lines = self.source.lines().count(); - let height = lines as f32 * cx.line_height(); - v_flex() .size_full() // TODO: Move base cell render into trait impl so we don't have to repeat this @@ -582,7 +579,7 @@ impl Render for CodeCell { .border_1() .border_color(cx.theme().colors().border) .bg(cx.theme().colors().editor_background) - .child(div().h(height).w_full().child(self.editor.clone())), + .child(div().w_full().child(self.editor.clone())), ), ), )