From 4738a15c89998ca0cae5621be652bb401721cdd5 Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 29 Aug 2013 21:41:10 +0100 Subject: [PATCH] Added /win command to access unlimited windows --- src/command/command.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/command/command.c b/src/command/command.c index bae6a7c3..ef00fae8 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -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) {