1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-08 04:26:01 -04:00

added /WINDOW MOVE FIRST and /WINDOW MOVE LAST.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2923 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-09-14 23:30:05 +00:00 committed by cras
parent 3dda9ab2df
commit bb2ed605e5

View File

@ -619,17 +619,10 @@ static void cmd_window_move_next(void)
window_refnums_move_right(active_win);
}
/* SYNTAX: WINDOW MOVE <number>|<direction> */
static void cmd_window_move(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
static void active_window_move_to(int new_refnum)
{
int new_refnum, refnum;
int refnum;
if (!is_numeric(data, 0)) {
command_runsub("window move", data, server, item);
return;
}
new_refnum = atoi(data);
if (new_refnum > active_win->refnum) {
for (;;) {
refnum = window_refnum_next(active_win->refnum, FALSE);
@ -649,6 +642,29 @@ static void cmd_window_move(const char *data, SERVER_REC *server, WI_ITEM_REC *i
}
}
/* SYNTAX: WINDOW MOVE FIRST */
static void cmd_window_move_first(void)
{
active_window_move_to(1);
}
/* SYNTAX: WINDOW MOVE LAST */
static void cmd_window_move_last(void)
{
active_window_move_to(windows_refnum_last());
}
/* SYNTAX: WINDOW MOVE <number>|<direction> */
static void cmd_window_move(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
{
if (!is_numeric(data, 0)) {
command_runsub("window move", data, server, item);
return;
}
active_window_move_to(atoi(data));
}
/* SYNTAX: WINDOW LIST */
static void cmd_window_list(void)
{
@ -769,6 +785,8 @@ void window_commands_init(void)
command_bind("window move", NULL, (SIGNAL_FUNC) cmd_window_move);
command_bind("window move prev", NULL, (SIGNAL_FUNC) cmd_window_move_prev);
command_bind("window move next", NULL, (SIGNAL_FUNC) cmd_window_move_next);
command_bind("window move first", NULL, (SIGNAL_FUNC) cmd_window_move_first);
command_bind("window move last", NULL, (SIGNAL_FUNC) cmd_window_move_last);
command_bind("window list", NULL, (SIGNAL_FUNC) cmd_window_list);
command_bind("window theme", NULL, (SIGNAL_FUNC) cmd_window_theme);
command_bind("layout", NULL, (SIGNAL_FUNC) cmd_layout);
@ -808,6 +826,8 @@ void window_commands_deinit(void)
command_unbind("window move", (SIGNAL_FUNC) cmd_window_move);
command_unbind("window move prev", (SIGNAL_FUNC) cmd_window_move_prev);
command_unbind("window move next", (SIGNAL_FUNC) cmd_window_move_next);
command_unbind("window move first", (SIGNAL_FUNC) cmd_window_move_first);
command_unbind("window move last", (SIGNAL_FUNC) cmd_window_move_last);
command_unbind("window list", (SIGNAL_FUNC) cmd_window_list);
command_unbind("window theme", (SIGNAL_FUNC) cmd_window_theme);
command_unbind("layout", (SIGNAL_FUNC) cmd_layout);