1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Added /win command to access unlimited windows

This commit is contained in:
James Booth 2013-08-29 21:41:10 +01:00
parent 659e449e12
commit 4738a15c89

View File

@ -143,6 +143,7 @@ static gboolean _cmd_tiny(gchar **args, struct cmd_help_t help);
static gboolean _cmd_titlebar(gchar **args, struct cmd_help_t help);
static gboolean _cmd_vercheck(gchar **args, struct cmd_help_t help);
static gboolean _cmd_who(gchar **args, struct cmd_help_t help);
static gboolean _cmd_win(gchar **args, struct cmd_help_t help);
static gboolean _cmd_wins(gchar **args, struct cmd_help_t help);
static gboolean _cmd_xa(gchar **args, struct cmd_help_t help);
@ -409,6 +410,14 @@ static struct cmd_t command_defs[] =
"Example : /nick bob",
NULL } } },
{ "/win",
_cmd_win, parse_args, 1, 1, NULL,
{ "/win num", "View a window.",
{ "/win num",
"------------------",
"Show the contents of a specific window in the main window area.",
NULL } } },
{ "/wins",
_cmd_wins, parse_args, 0, 1, NULL,
{ "/wins [tidy|prune]", "List or tidy active windows.",
@ -1662,6 +1671,19 @@ _cmd_wins(gchar **args, struct cmd_help_t help)
return TRUE;
}
static gboolean
_cmd_win(gchar **args, struct cmd_help_t help)
{
int num = atoi(args[0]);
if (ui_win_exists(num)) {
ui_switch_win(num);
} else {
cons_show("Window %d does not exist.", num);
}
return TRUE;
}
static
gint _compare_commands(Command *a, Command *b)
{