mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-09-07 19:36:23 +02:00
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:
+11
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user