forked from 1b-agent/opencadstudio-upstream
feat(rename): prompt RENAME step by step instead of requiring all args
Bare RENAME printed a usage line and did nothing; only the fully-typed `RENAME <type> <old> <new>` form worked. Add a stepped front-end (RenameCommand) that prompts for the object type — as clickable buttons (Layer, Text style, Dim style, Linetype, UCS, View) — then the current name, then the new name, and dispatches to the existing inline handler. The rename logic stays in one place; the argument form is kept and is also the front-end's dispatch target. BLOCK is left off the buttons because the inline handler does not implement it.
This commit is contained in:
1 parent
60c70ba023
commit
7cd5010729
2 files changed
+122
-1
No files matched your search
@@ -1372,7 +1372,16 @@ impl OpenCADStudio {
|
||||
}
|
||||
|
||||
// ── RENAME table entries ──────────────────────────────────────
|
||||
cmd if cmd == "RENAME" || cmd.starts_with("RENAME ") => {
|
||||
// Bare RENAME prompts step by step (type → old → new); the argument
|
||||
// form below both handles a fully-typed line and is the target the
|
||||
// stepped front-end dispatches to.
|
||||
"RENAME" => {
|
||||
use crate::command::RenameCommand;
|
||||
let c = RenameCommand::new();
|
||||
self.command_line.push_info(&c.prompt());
|
||||
self.tabs[i].active_cmd = Some(Box::new(c));
|
||||
}
|
||||
cmd if cmd.starts_with("RENAME ") => {
|
||||
// Usage: RENAME <type> <old_name> <new_name>
|
||||
// Types: LAYER BLOCK STYLE DIMSTYLE LINETYPE UCS VIEW
|
||||
let parts: Vec<&str> = cmd.split_whitespace().collect();
|
||||
|
||||
Reference in new issue
Block a user