Measure maximum width of each cell to render table (#14026)

This commit is contained in:
Kyle Kelley 2024-07-09 14:19:10 -07:00 committed by GitHub
parent c4bca874b6
commit 4bb8a0845f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 97 additions and 33 deletions

View file

@ -89,6 +89,7 @@ impl EditorBlock {
let render = move |cx: &mut BlockContext| {
let execution_view = execution_view.clone();
let text_font = ThemeSettings::get_global(cx).buffer_font.family.clone();
let text_font_size = ThemeSettings::get_global(cx).buffer_font_size;
// Note: we'll want to use `cx.anchor_x` when someone runs something with no output -- just show a checkmark and not make the full block below the line
let gutter_width = cx.gutter_dimensions.width;
@ -101,6 +102,7 @@ impl EditorBlock {
.pl(gutter_width)
.child(
div()
.text_size(text_font_size)
.font_family(text_font)
// .ml(gutter_width)
.mx_1()