forked from 1b-agent/opencadstudio-upstream
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:
1 parent
43cca2094b
commit
4143a01ff4
3 files changed
+139
-3
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user