From 708c82cf2c5aa5c28ea427b42d62e6eae76c88b9 Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 22 Oct 2026 02:35:09 +0000 Subject: [PATCH] Integration: #1059 delete_areas accepts a single row or column home.deleteRows {rows:"2"} and home.deleteColumns {cols:"B"} failed with "not a range"; delete_areas now parses with parse_lines. The PR's test covers both. --- crates/engine/src/cmd/data.rs | 3 +++ crates/engine/src/cmd/sheet.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/data.rs b/crates/engine/src/cmd/data.rs index 15d0d779b..a36fe09c6 100644 --- a/crates/engine/src/cmd/data.rs +++ b/crates/engine/src/cmd/data.rs @@ -1542,6 +1542,9 @@ mod tests { s.execute("home.hideRows", json!({"rows": "1"})).unwrap(); s.execute("data.group", json!({"cols": "C"})).unwrap(); assert!(s.execute("home.deleteRows", json!({"rows": "0"})).is_err()); + s.execute("home.deleteRows", json!({"rows": "2"})).unwrap(); + s.execute("home.deleteColumns", json!({"cols": "B"})).unwrap(); + assert_eq!(v(&mut s, "B2"), json!(4.0)); } #[test] diff --git a/crates/engine/src/cmd/sheet.rs b/crates/engine/src/cmd/sheet.rs index a81634e9a..412ca3df7 100644 --- a/crates/engine/src/cmd/sheet.rs +++ b/crates/engine/src/cmd/sheet.rs @@ -306,7 +306,7 @@ fn delete_areas(s: &Session, p: &Json, axis: Axis) -> Result> { } else if let Some(t) = str_param(p, key).or_else(|| str_param(p, "range")) { t.split(',') .map(|part| { - let r = RangeRef::parse(part).ok_or_else(|| bad(key, format!("not a range: {part}")))?; + let r = parse_lines(part).ok_or_else(|| bad(key, format!("not a range: {part}")))?; Ok(if axis == Axis::Rows { (r.start.row, r.end.row) } else { (r.start.col, r.end.col) }) }) .collect::>()?