Modified the "select" command parsing to detect the few command options

that don't require the cursor to be in a window, and avoid returning
immediately from the command in those cases.  That allows a setting
like "select simple labels" to be set in the user's .magicrc file, for
example.
This commit is contained in:
R. Timothy Edwards
2026-09-01 14:57:49 -04:00
parent 307e22af30
commit f63e7dad5a
+11 -2
View File
@@ -879,10 +879,19 @@ CmdSelect(
globmatch = NULL;
bzero(&scx, sizeof(SearchContext));
windCheckOnlyWindow(&w, DBWclientID);
/* Quick check on 1st argument to avoid rejecting command options
* "select do|no|simple labels" and "select help" if the cursor is not
* in a layout window, since these two options don't require it.
*/
if ((w == (MagWindow *) NULL) || (w->w_client != DBWclientID))
{
TxError("Put the cursor in a layout window\n");
return;
if (strcmp(cmd->tx_argv[1], "simple") && strcmp(cmd->tx_argv[1], "help")
&& strcmp(cmd->tx_argv[1], "do") && strcmp(cmd->tx_argv[1], "no"))
{
TxError("Put the cursor in a layout window\n");
return;
}
}
/* See if "more" was given. If so, just strip off the "more" from