From d473e2f6f777216db9da5a0535d8c7b41eabea7a Mon Sep 17 00:00:00 2001 From: Alberto Mengali Date: Thu, 25 Sep 2025 12:13:01 +0200 Subject: [PATCH 1/2] make `0` autosize column width as documented --- src/backends/text/text_backend.jl | 2 +- test/backends/text/line_breaks.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/text/text_backend.jl b/src/backends/text/text_backend.jl index 6609b520..940c3719 100644 --- a/src/backends/text/text_backend.jl +++ b/src/backends/text/text_backend.jl @@ -166,7 +166,7 @@ function _text__print_table( mc = 1 for j in eachindex(fixed_data_column_widths) - aux += fixed_data_column_widths[j] < 0 ? 5 : fixed_data_column_widths[j] + aux += fixed_data_column_widths[j] <= 0 ? 5 : fixed_data_column_widths[j] aux > display.size[2] && break mc += 1 end diff --git a/test/backends/text/line_breaks.jl b/test/backends/text/line_breaks.jl index acd6617a..1084d569 100644 --- a/test/backends/text/line_breaks.jl +++ b/test/backends/text/line_breaks.jl @@ -153,7 +153,7 @@ end table; auto_wrap = true, column_labels = column_labels, - fixed_data_column_widths = [-1, 30], + fixed_data_column_widths = [0, 30], line_breaks = true, table_format = TextTableFormat(; @text__all_horizontal_lines) ) From 306deca6ec1de058bbecdb31dd588f2c85e8e94e Mon Sep 17 00:00:00 2001 From: Alberto Mengali Date: Thu, 25 Sep 2025 12:26:12 +0200 Subject: [PATCH 2/2] update check also in inner function --- src/backends/text/column_widths.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/text/column_widths.jl b/src/backends/text/column_widths.jl index edefee80..e967e7c4 100644 --- a/src/backends/text/column_widths.jl +++ b/src/backends/text/column_widths.jl @@ -32,7 +32,7 @@ function _text__fix_data_column_widths!( ) for j in eachindex(printed_data_column_widths) fcw = fixed_data_column_widths[j - 1 + begin] - (fcw < 0) && continue + (fcw <= 0) && continue printed_data_column_widths[j] = fixed_data_column_widths[j - 1 + begin] if auto_wrap