From df616482e2dcea791dfce497986633fe14081181 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Mon, 15 Jun 2026 13:31:25 +0300 Subject: [PATCH] fix(input): honor @ / # coordinate prefixes during dynamic input While DYN fields were showing, a leading @ or # landed in the command line but the following digits were captured by the focused DYN field, splitting the value so the prefix never resolved. Treat a leading @ / # as an escape: route the whole coordinate (digits and separators) to the command line so the relative (@) / absolute (#) prefix works the same whether DYN is on or off. Co-Authored-By: Claude Opus 4.8 --- src/app/update.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/app/update.rs b/src/app/update.rs index bee9796c0..1c51ebaa4 100644 --- a/src/app/update.rs +++ b/src/app/update.rs @@ -1033,7 +1033,19 @@ impl OpenCADStudio { // reshaping the field set when going polar → cartesian // (Distance → X, Y) or 2-D → 3-D (X, Y → X, Y, Z). // See #35. - if s == "," && self.dyn_input && !self.tabs[i].dyn_fields.is_empty() { + // A leading `@` / `#` escapes dynamic-input capture: the + // whole coordinate is typed into the command line so the + // prefix's relative / absolute meaning is honoured even + // while DYN fields are showing. Without this, the prefix + // lands in the command line while the digits go to a DYN + // field, splitting the value. + let coord_prefix_escape = self.command_line.input.starts_with('@') + || self.command_line.input.starts_with('#'); + if s == "," + && self.dyn_input + && !self.tabs[i].dyn_fields.is_empty() + && !coord_prefix_escape + { self.dyn_comma_advance(); self.command_line.autocomplete_cursor = None; return self.focus_cmd_input(); @@ -1047,7 +1059,11 @@ impl OpenCADStudio { c.is_ascii_digit() || matches!(c, '.' | '-' | '+' | '*' | '/' | '^' | '%' | '(' | ')') }); - if dyn_field_char && self.dyn_input && !self.tabs[i].dyn_fields.is_empty() { + if dyn_field_char + && self.dyn_input + && !self.tabs[i].dyn_fields.is_empty() + && !coord_prefix_escape + { let a = self.tabs[i] .dyn_active .min(self.tabs[i].dyn_fields.len() - 1);