From f65e481c95586f25273227cb51e56bea81df8dbe Mon Sep 17 00:00:00 2001 From: Zach Berry <1112351+zberry@users.noreply.github.com> Date: Tue, 17 Nov 2026 20:57:38 -0600 Subject: [PATCH] Column insert: the per-row template keeps the formatting only The template cloned the whole anchor cell, text included, once per covered row. It is now an empty cell given the anchor's formatting. A test comment described a default the command never had. Co-Authored-By: Claude Fable 5.2 --- crates/engine/src/cmd/table.rs | 7 ++++++- crates/engine/src/tests.rs | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/table.rs b/crates/engine/src/cmd/table.rs index 7695dc1ad..5d0ad0237 100644 --- a/crates/engine/src/cmd/table.rs +++ b/crates/engine/src/cmd/table.rs @@ -390,7 +390,12 @@ fn insert_col_like(t: &mut Table, at: usize, neighbour: usize, keep_width: bool) break; } } - t.rows[r].cells.get(n).cloned() + // Only the formatting is kept: the anchor's text is not copied once per covered row. + t.rows[r].cells.get(n).map(|src| { + let mut tpl = Cell::new(""); + copy_cell_format(&mut tpl, src); + tpl + }) }) .collect(); if !t.insert_col(at) { diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 6a5aaa015..c78f06699 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -7297,8 +7297,8 @@ fn master_body_placeholder_format_keeps_per_level_formatting() { assert_eq!(shown(&s), vec![Some(28.0), Some(24.0)]); } -/// A `keepWidth` that is not a bool is refused, naming it, and the table is left alone; it used -/// to be read as absent and the columns shrunk as if `true` had been asked. +/// A `keepWidth` that is not a bool is refused, naming it, and the table is left alone, not read +/// as the default (the table growing by the new column). #[test] fn table_insert_column_refuses_a_keep_width_that_is_not_a_bool() { let mut s = session();