From 9b518ff9124a3374301c2828cbea33ecfac04071 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 15 Oct 2026 03:57:33 +0300 Subject: [PATCH] sysvar: SELECTIONCYCLING Selection cycling was reachable only from the status bar and Options. SELECTIONCYCLING / SETVAR now read and set it: 0 off, 1 or 2 on (the candidate list always shows). Co-Authored-By: Claude Opus 5.5 --- src/app/commands/mod.rs | 1 + src/app/commands/styleprops.rs | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/app/commands/mod.rs b/src/app/commands/mod.rs index 807e33528..16fc008d1 100644 --- a/src/app/commands/mod.rs +++ b/src/app/commands/mod.rs @@ -757,6 +757,7 @@ inventory::submit!(crate::command::CommandRegistration { "FIELDDISPLAY", "FILEDIA", "TRIMEXTENDMODE", + "SELECTIONCYCLING", "SURFACEASSOCIATIVITY", "LAYOUTCREATEVIEWPORT", "FIELDEVAL", diff --git a/src/app/commands/styleprops.rs b/src/app/commands/styleprops.rs index 77683445d..b3fc68078 100644 --- a/src/app/commands/styleprops.rs +++ b/src/app/commands/styleprops.rs @@ -1215,6 +1215,7 @@ impl OpenCADStudio { | "FIELDDISPLAY" | "FILEDIA" | "TRIMEXTENDMODE" + | "SELECTIONCYCLING" | "SURFACEASSOCIATIVITY" | "UCSORTHO" | "UCSVIEW" @@ -1631,6 +1632,37 @@ impl OpenCADStudio { } return Some(self.finish_dispatch(cmd)); } + if name == "SELECTIONCYCLING" { + // 1 and 2 both turn cycling on; the candidate list + // always shows. + let current = if self.selection_cycling { 2 } else { 0 }; + let prompt = format!("Enter new value for SELECTIONCYCLING <{current}>:"); + match value + .as_deref() + .map(|v| v.trim().parse::().ok().filter(|v| (0..=2).contains(v))) + { + Some(Some(mode)) => { + if self.selection_cycling != (mode != 0) { + self.selection_cycling = mode != 0; + self.cycle_candidates = None; + self.persist_settings_if_changed(); + } + } + Some(None) => { + let (min, max) = (0, 2); + self.command_line.push_error(&crate::tf!( + "Requires an integer between {min} and {max}." + )); + self.command_line.push_output(&prompt); + self.pending_setvar = Some(name.clone()); + } + None => { + self.command_line.push_output(&prompt); + self.pending_setvar = Some(name.clone()); + } + } + return Some(self.finish_dispatch(cmd)); + } if name == "FILEDIA" { let current = i16::from(crate::sys::file_dia()); match value