From 29ccfcfc46990812c1ecb982885cf17e650650d4 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Sun, 14 Jun 2026 00:59:52 +0300 Subject: [PATCH] fix(command): accept typed points/Enter in keyword steps when DYN is off (#97) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A command step that takes both a point and option keywords (PLINE, MLINE) returns true from wants_text_input to receive the keywords, but CommandSubmit then routed the text only to on_text_input and, on a None (unhandled) result, re-prompted instead of falling through. So with dynamic input off, typed coordinates and a bare Enter were swallowed — points couldn't be added by keyboard and the command couldn't be ended. Fall through to the existing Enter / coordinate handling when on_text_input doesn't consume the text. Coordinates (including @ and # prefixes) and Enter now work in these steps with DYN both on and off; commands that fully handle their text step still return Some and are unaffected. Co-Authored-By: Claude Opus 4.8 --- src/app/update.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/app/update.rs b/src/app/update.rs index b880c9a68..510a4bf31 100644 --- a/src/app/update.rs +++ b/src/app/update.rs @@ -1228,6 +1228,12 @@ impl OpenCADStudio { let text = super::expr_eval::eval_to_string(self.command_line.input.trim()); self.command_line.input.clear(); + // Offer the typed text to the command's option handler + // first (keywords like PLINE's A/L/C, a radius, …). If it + // consumes the text we're done; if it returns None the + // text falls through to the Enter / coordinate handling + // below, so a bare Enter still terminates and typed points + // still work when dynamic input is off. See #97. if self.tabs[i] .active_cmd .as_ref() @@ -1241,18 +1247,6 @@ impl OpenCADStudio { { return self.apply_cmd_result(result); } - let prompt = self.tabs[i].active_cmd.as_ref().map(|c| c.prompt()); - if let Some(p) = prompt { - self.command_line.push_info(&p); - } - let pt = self.tabs[i].last_cursor_world; - let previews = self.tabs[i] - .active_cmd - .as_mut() - .map(|c| c.on_preview_wires(pt)) - .unwrap_or_default(); - self.tabs[i].scene.set_preview_wires(previews); - return self.focus_cmd_input(); } if text.is_empty() {