fix(plugin): drive headless tasks, invalidate layer cache, and handle cancel event

This commit is contained in:
yztink committed 2026-09-21 16:29:01 -07:00
1 parent bc6ad1a5fe
commit 270b6102de
10 files changed
+208 -20

No files matched your search

+1 -1
View File
@@ -244,7 +244,7 @@ impl OpenCADStudio {
/// `Some(task)` for an arm it owns (early-returning or falling through to
/// `finish_dispatch`), or `None` to defer to the next — equivalent to one
/// sequential `match` over all arms.
fn dispatch_families(&mut self, cmd: &str, i: usize) -> Option<Task<Message>> {
pub(crate) fn dispatch_families(&mut self, cmd: &str, i: usize) -> Option<Task<Message>> {
if let Some(t) = self.dispatch_fileops(cmd, i) {
return Some(t);
}
+11
View File
@@ -2710,8 +2710,19 @@ impl OpenCADStudio {
.push_output(crate::tf!("CLAYER = \"{cur}\"").as_ref());
} else {
if self.tabs[i].scene.document.layers.contains(name_arg) {
let handle = self.tabs[i]
.scene
.document
.layers
.get(name_arg)
.map(|l| l.handle)
.unwrap_or(acadrust::types::Handle::NULL);
self.tabs[i].scene.document.header.current_layer_name =
name_arg.to_string();
self.tabs[i].scene.document.header.current_layer_handle = handle;
self.tabs[i].active_layer = name_arg.to_string();
self.tabs[i].layers.current_layer = name_arg.to_string();
self.ribbon.active_layer = name_arg.to_string();
self.tabs[i].dirty = true;
self.command_line
.push_output(crate::tf!("CLAYER set to \"{name_arg}\"").as_ref());