fix(commands): deny list during BEDIT

Refuse LAYOUT, VPORTS, MVIEW, WBLOCK, PURGE, RENAME, REFEDIT,
REFEDIT_BEGIN and PLOT from the command line while a block editor
session is open, matching the reference product's
"<CMD> command not allowed in block editor" behaviour (spec section 8,
based on the V7 hands-on check). XREF, NEW, OPEN and SAVEAS stay
allowed. The service-level RENAME guard stays as defense in depth.
This commit is contained in:
Karim Jerbi committed 2026-10-15 20:06:41 +01:00
1 parent 43cca2094b
commit 4143a01ff4
3 files changed
+139 -3

No files matched your search

+24
View File
@@ -209,6 +209,30 @@ impl OpenCADStudio {
return Task::none();
}
}
// V7 (reference check): inside a block editor session a set of
// commands is refused outright. The hook sits after alias resolution
// and before the transparent split and the running-command teardown,
// so a rejected command leaves whatever is running untouched.
if self.tabs[i].active_block_edit.is_some() {
let name = cmd.split([' ', ':']).next().unwrap_or(cmd);
if matches!(
name,
"LAYOUT"
| "VPORTS"
| "MVIEW"
| "WBLOCK"
| "PURGE"
| "RENAME"
| "REFEDIT"
| "REFEDIT_BEGIN"
| "PLOT"
) {
self.command_line.push_error(
crate::tf!("{} command not allowed in block editor", name).as_ref(),
);
return Task::none();
}
}
if is_spacemouse_command(cmd) {
return self.run_action(cmd);
}