Fix notebook cell-height when soft-wrapping lines (#19933)

This commit is contained in:
Lukas Geiger 2024-10-30 14:12:32 +00:00 committed by GitHub
parent d49cd0019f
commit 83e2889d63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -553,9 +553,6 @@ impl RunnableCell for CodeCell {
impl Render for CodeCell {
fn render(&mut self, cx: &mut ViewContext<Self>) -> 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())),
),
),
)