Add PTYPE as an alias of the Point Style command (#622) (#645)

Squash of PR #645 by @MarekSpodBiedry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MarekSpodBiedryandClaude Opus 5.5 authored and GitHub committed 2026-10-11 19:52:37 -04:00
1 parent 54ea5e743a
commit 83b8a84050
3 files changed
+8 -2

No files matched your search

+4 -1
View File
@@ -60,7 +60,10 @@ pub fn specs() -> Vec<CommandSpec> {
.menu(&["Format", "Multileader Style..."])
.alias(&["mls"])
.params("{name, arrowSize?, textHeight?, landingGap?, dogleg?, textStyle?, annotative?, current?} → styles"),
CommandSpec::new("ddptype", "Point Style...", run_ptype).menu(&["Format", "Point Style..."]).params("{pdmode, pdsize}"),
CommandSpec::new("ddptype", "Point Style...", run_ptype)
.menu(&["Format", "Point Style..."])
.alias(&["ptype"])
.params("{pdmode, pdsize}"),
CommandSpec::new("rename", "Rename...", run_rename)
.menu(&["Format", "Rename..."])
.alias(&["ren", "-rename"])
+1 -1
View File
@@ -26,7 +26,7 @@ pub fn route(app: &mut CadApp, id: &str, params: &Value) -> Option<Result<Value,
let dialog = match id {
"battman" => "battman",
"linetype" | "lt" | "ltype" => "linetype",
"ddptype" => "ptype",
"ddptype" | "ptype" => "ptype",
"style" | "st" => "textstyle",
"tablestyle" | "ts" => "tablestyle",
"mleaderstyle" | "mls" => "mleaderstyle",
+3
View File
@@ -29,6 +29,9 @@ fn menu_items_open_their_dialogs() {
app.ui.dialog = None;
app.cmdline("LT");
assert_eq!(app.ui.dialog.as_deref(), Some("linetype"), "typed aliases open it too");
app.ui.dialog = None;
assert!(app.cmdline("PTYPE").is_none(), "bare PTYPE is not an error");
assert_eq!(app.ui.dialog.as_deref(), Some("ptype"), "PTYPE opens the Point Style dialog");
for typed in ["style", "ST"] {
app.ui.dialog = None;
assert!(app.cmdline(typed).is_none(), "bare {typed} is not an error");