Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix select more|less processing #296

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions commands/CmdRS.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ CmdSelect(w, cmd)
char *tclstr;
Tcl_Obj *lobj;
#endif
int original_cmd_length = cmd->tx_argc;

/* How close two clicks must be to be considered the same point: */

Expand Down Expand Up @@ -1317,14 +1318,17 @@ CmdSelect(w, cmd)
window = CmdGetRootPoint((Point *) NULL, &scx.scx_area);

/* Recast command with "at x y" at the end for logging */
for (i = 0; i < cmd->tx_argc; i++)
int argc_adjustment = original_cmd_length - cmd->tx_argc; // need to restore argc adjustments;
for (i = 0; i < original_cmd_length; i++)
{
aptr = cmd->tx_argv[i] + strlen(cmd->tx_argv[i]);
*aptr = ' ';
}
sprintf(aptr + 1, "at %di %di", scx.scx_area.r_xbot,
scx.scx_area.r_ybot);
TxRebuildCommand(cmd);
original_cmd_length = cmd->tx_argc; // Reset original_cmd_length
cmd->tx_argc = cmd->tx_argc - argc_adjustment; // Readjust argument count

}
if (window == NULL) return;
Expand Down Expand Up @@ -1552,7 +1556,7 @@ CmdSelect(w, cmd)
}

if (cmd->tx_argc > 3)
if (strcmp(cmd->tx_argv[cmd->tx_argc - 3], "at"))
if (strcmp(cmd->tx_argv[original_cmd_length - 3], "at"))
goto usageError;

/* If an explicit cell use id is provided, look for that cell
Expand Down