mirror of
https://github.com/irssi/irssi.git
synced 2025-04-26 04:51:11 -05:00
/WINDOW ITEM GOTO now accepts a number too, to jump to nth window item.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2693 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
9b74ba4e5c
commit
1ab2cfc1b1
@ -427,7 +427,12 @@ static void cmd_window_server(const char *data)
|
|||||||
|
|
||||||
static void cmd_window_item(const char *data, void *server, WI_ITEM_REC *item)
|
static void cmd_window_item(const char *data, void *server, WI_ITEM_REC *item)
|
||||||
{
|
{
|
||||||
command_runsub("window item", data, server, item);
|
while (*data == ' ') data++;
|
||||||
|
|
||||||
|
if (is_numeric(data, '\0'))
|
||||||
|
signal_emit("command window item goto", 3, data, server, item);
|
||||||
|
else
|
||||||
|
command_runsub("window item", data, server, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SYNTAX: WINDOW ITEM PREV */
|
/* SYNTAX: WINDOW ITEM PREV */
|
||||||
@ -442,12 +447,20 @@ static void cmd_window_item_next(void)
|
|||||||
window_item_next(active_win);
|
window_item_next(active_win);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SYNTAX: WINDOW ITEM GOTO <name> */
|
/* SYNTAX: WINDOW ITEM GOTO <number>|<name> */
|
||||||
static void cmd_window_item_goto(const char *data, SERVER_REC *server)
|
static void cmd_window_item_goto(const char *data, SERVER_REC *server)
|
||||||
{
|
{
|
||||||
WI_ITEM_REC *item;
|
WI_ITEM_REC *item;
|
||||||
|
GSList *tmp;
|
||||||
|
|
||||||
|
if (is_numeric(data, '\0')) {
|
||||||
|
/* change to specified number */
|
||||||
|
tmp = g_slist_nth(active_win->items, atoi(data)-1);
|
||||||
|
item = tmp == NULL ? NULL : tmp->data;
|
||||||
|
} else {
|
||||||
|
item = window_item_find_window(active_win, server, data);
|
||||||
|
}
|
||||||
|
|
||||||
item = window_item_find_window(active_win, server, data);
|
|
||||||
if (item != NULL)
|
if (item != NULL)
|
||||||
window_item_set_active(active_win, item);
|
window_item_set_active(active_win, item);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user