forked from 1b-agent/opencadstudio-upstream
fix(snap): typed overrides yield to the prompt's options; one point-step gate
#1707 took any snap name typed at a point prompt as an override, so a prompt offering Center, Tangent, Parallel or None (ARC, ELLIPSE, CIRCLE TTR, ...) could no longer be answered with that option's name. An option the prompt offers now wins. The point-step test it copied from MTP is one helper shared by MTP and the override on both input paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
45bc31f730
commit
23b21b5d77
3 files changed
+38
-73
No files matched your search
@@ -1121,46 +1121,14 @@ impl OpenCADStudio {
|
||||
let is_mtp = token.trim_start_matches('_').eq_ignore_ascii_case("MTP")
|
||||
|| token.trim_start_matches('_').eq_ignore_ascii_case("M2P");
|
||||
if is_mtp {
|
||||
let is_point_step = !self.tabs[i]
|
||||
.active_cmd
|
||||
.as_ref()
|
||||
.map(|c| c.input_kind().wants_text())
|
||||
.unwrap_or(true)
|
||||
|| self.tabs[i]
|
||||
.active_cmd
|
||||
.as_ref()
|
||||
.map(|c| c.point_step_accepts_keywords())
|
||||
.unwrap_or(false);
|
||||
let not_entity_pick = !self.tabs[i]
|
||||
.active_cmd
|
||||
.as_ref()
|
||||
.map(|c| c.needs_entity_pick())
|
||||
.unwrap_or(false);
|
||||
if is_point_step && not_entity_pick {
|
||||
if self.point_modifier_step(i) {
|
||||
self.start_mtp_modifier(i);
|
||||
return Task::none();
|
||||
}
|
||||
}
|
||||
if let Some(override_kind) = crate::snap::parse_snap_override(token) {
|
||||
let is_point_step = !self.tabs[i]
|
||||
.active_cmd
|
||||
.as_ref()
|
||||
.map(|c| c.input_kind().wants_text())
|
||||
.unwrap_or(true)
|
||||
|| self.tabs[i]
|
||||
.active_cmd
|
||||
.as_ref()
|
||||
.map(|c| c.point_step_accepts_keywords())
|
||||
.unwrap_or(false);
|
||||
let not_entity_pick = !self.tabs[i]
|
||||
.active_cmd
|
||||
.as_ref()
|
||||
.map(|c| c.needs_entity_pick())
|
||||
.unwrap_or(false);
|
||||
if is_point_step && not_entity_pick {
|
||||
self.apply_snap_override(override_kind);
|
||||
return Task::none();
|
||||
}
|
||||
if let Some(kind) = self.typed_snap_override(i, token) {
|
||||
self.apply_snap_override(kind);
|
||||
return Task::none();
|
||||
}
|
||||
if let Some((coord, kind)) = crate::app::helpers::parse_coord(token) {
|
||||
// Match the GUI command line: typed coordinates are in the active
|
||||
|
||||
Reference in new issue
Block a user