From f2473d1f337f1cf2ea50a96c7330bb2338263f46 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Mon, 19 Oct 2026 12:20:46 -0400 Subject: [PATCH] Ctrl+Shift+= on several whole-row areas still opens the Insert dialog Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/ribbon.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/ribbon.rs b/crates/ui-egui/src/ribbon.rs index d7c6bd697..662c87ef1 100644 --- a/crates/ui-egui/src/ribbon.rs +++ b/crates/ui-egui/src/ribbon.rs @@ -2462,7 +2462,8 @@ pub fn shortcut(app: &mut SheetApp, key: Key, m: Modifiers) { None } }, - Key::Plus | Key::Equals if shift => match whole_lines(app) { + // Insert works on one area at a time, so several areas still go through the dialog. + Key::Plus | Key::Equals if shift => match whole_lines(app).filter(|_| single_area(app)) { Some(true) => Some(("home.insertRows", json!({}))), Some(false) => Some(("home.insertColumns", json!({}))), None => { @@ -2525,6 +2526,11 @@ mod checkbox_on_tests { } } +/// Whether the selection is a single area. +fn single_area(app: &SheetApp) -> bool { + app.session.active().is_some_and(|d| d.selection.ranges.len() == 1) +} + /// `Some(true)` when every selected area is whole rows, `Some(false)` when every one is whole /// columns, `None` otherwise (including the whole sheet). fn whole_lines(app: &SheetApp) -> Option {