mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Make cmd_window_item_goto use cmd_get_params, so "/WINDOW ITEM GOTO item<space>" (for example) works
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3323 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
9204602326
commit
9999862664
@ -462,17 +462,24 @@ static void cmd_window_item_goto(const char *data, SERVER_REC *server)
|
||||
{
|
||||
WI_ITEM_REC *item;
|
||||
GSList *tmp;
|
||||
void *free_arg;
|
||||
char *target;
|
||||
|
||||
if (!cmd_get_params(data, &free_arg, 1, &target))
|
||||
return;
|
||||
|
||||
if (is_numeric(data, '\0')) {
|
||||
if (is_numeric(target, '\0')) {
|
||||
/* change to specified number */
|
||||
tmp = g_slist_nth(active_win->items, atoi(data)-1);
|
||||
tmp = g_slist_nth(active_win->items, atoi(target)-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, target);
|
||||
}
|
||||
|
||||
if (item != NULL)
|
||||
window_item_set_active(active_win, item);
|
||||
|
||||
cmd_params_free(free_arg);
|
||||
}
|
||||
|
||||
/* SYNTAX: WINDOW ITEM MOVE <number>|<name> */
|
||||
|
Loading…
Reference in New Issue
Block a user