From 3207cb391bac3ce36f88de9561a00d93e10e9d3c Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Tue, 21 Jul 2026 23:18:18 +0300 Subject: [PATCH] feat(view): bare ZOOM prompts with mode options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ZOOM alone used to jump straight into window zoom. It now offers Window / Extents / All / In / Out / Scale as clickable keywords (Scale collects the factor in a second step); ZW/ZE/… shortcuts and the spelled sub-forms still run directly. Co-Authored-By: Claude Fable 5 --- src/app/commands/dim.rs | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/app/commands/dim.rs b/src/app/commands/dim.rs index ccadcbbc4..37c992c15 100644 --- a/src/app/commands/dim.rs +++ b/src/app/commands/dim.rs @@ -727,10 +727,26 @@ impl OpenCADStudio { self.tabs[i].active_cmd = Some(Box::new(cmd)); } - // Bare ZOOM enters the interactive window zoom (pick two corners) — - // the common "zoom to a rectangle" action. The sub-keyword forms - // (ZOOM EXTENTS / IN / OUT / …) are matched above. - "ZOOM WINDOW" | "ZOOM W" | "ZW" | "ZOOM" => { + // Bare ZOOM prompts with the mode options as clickable keywords; + // the sub-keyword forms (ZOOM EXTENTS / WINDOW / …) run directly. + "ZOOM" => { + use crate::command::KeywordCommand; + let c = KeywordCommand::new( + "ZOOM", + "ZOOM [Window / Extents / All / In / Out / Scale]:", + vec![ + ("Window", "WINDOW", None), + ("Extents", "EXTENTS", None), + ("All", "ALL", None), + ("In", "IN", None), + ("Out", "OUT", None), + ("Scale", "SCALE", Some("ZOOM scale factor (e.g. 2 or 0.5):")), + ], + ); + self.command_line.push_info(&c.prompt()); + self.tabs[i].active_cmd = Some(Box::new(c)); + } + "ZOOM WINDOW" | "ZOOM W" | "ZW" => { use crate::modules::view::zoom_window::ZoomWindowCommand; let new_cmd = ZoomWindowCommand::new(); self.command_line.push_info(&new_cmd.prompt());