From c3ec56725b5cb49ae37587644abed0ac972ac37a Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Sat, 8 Jul 2023 21:58:12 -0400 Subject: [PATCH] Corrected a few errors from the previous commit (support for logging commands without any pointer or screen coordinate references). --- commands/CmdCD.c | 7 +++++++ commands/CmdE.c | 8 ++++++++ commands/CmdRS.c | 15 ++++++++++++++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/commands/CmdCD.c b/commands/CmdCD.c index 88d7b800..3437d6d4 100644 --- a/commands/CmdCD.c +++ b/commands/CmdCD.c @@ -3863,6 +3863,13 @@ CmdDown(w, cmd) (void) WindSearch(DBWclientID, (ClientData) NULL, (Rect *) NULL, cmdEditRedisplayFunc, (ClientData) &area); DBWloadWindow(w, EditCellUse->cu_def->cd_name, DBW_LOAD_IGNORE_TECH); + + if ((cmd->tx_argc == 1) && cmdFoundNewDown) + { + /* Recast the command with the instance name for logging */ + sprintf(cmd->tx_argstring, "down %s", EditCellUse->cu_id); + TxRebuildCommand(cmd); + } } /* Search function to find the new edit cell: look for a cell use diff --git a/commands/CmdE.c b/commands/CmdE.c index dd0b7a24..b1166135 100644 --- a/commands/CmdE.c +++ b/commands/CmdE.c @@ -179,6 +179,14 @@ CmdEdit(w, cmd) GeoTransRect(&EditToRootTransform, &(EditCellUse->cu_def->cd_bbox), &area); (void) WindSearch(DBWclientID, (ClientData) NULL, (Rect *) NULL, cmdEditRedisplayFunc, (ClientData) &area); + + if ((cmd->tx_argc == 1) && cmdFoundNewEdit) + { + /* Recast the command with the instance name for logging */ + sprintf(cmd->tx_argstring, "edit %s", EditCellUse->cu_id); + TxRebuildCommand(cmd); + } + } /* Search function to handle redisplays for CmdEdit: it checks to diff --git a/commands/CmdRS.c b/commands/CmdRS.c index aa9ede4c..8e89fd91 100644 --- a/commands/CmdRS.c +++ b/commands/CmdRS.c @@ -1551,7 +1551,9 @@ Okay: return; } - if (cmd->tx_argc > 3) goto usageError; + if (cmd->tx_argc > 3) + if (strcmp(cmd->tx_argv[cmd->tx_argc - 3], "at")) + goto usageError; /* If an explicit cell use id is provided, look for that cell * and select it. In this case, defeat all of the "multiple @@ -3215,6 +3217,17 @@ CmdStretch(w, cmd) GeoTransTranslate(xdelta, ydelta, &GeoIdentityTransform, &t); GeoTransRect(&t, &rootBox, &newBox); DBWSetBox(rootDef, &newBox); + + /* Recast the command in the usual 3-argument form for logging */ + if (ydelta > 0) + sprintf(cmd->tx_argstring, "stretch n %di", ydelta); + else if (ydelta < 0) + sprintf(cmd->tx_argstring, "stretch s %di", -ydelta); + else if (xdelta > 0) + sprintf(cmd->tx_argstring, "stretch e %di", xdelta); + else + sprintf(cmd->tx_argstring, "stretch w %di", -xdelta); + TxRebuildCommand(cmd); } SelectStretch(xdelta, ydelta);