diff options
author | Timo Sirainen <cras@irssi.org> | 2002-09-14 23:30:05 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-09-14 23:30:05 +0000 |
commit | bb2ed605e5c0cd7afc745972e10d5cd17a13e0cb (patch) | |
tree | badab0357ffca222bf1c2642fdcd2979bb7759d1 /src/fe-common/core | |
parent | 3dda9ab2dfdde389c516e2a35f4d7f56f90b6a37 (diff) | |
download | irssi-bb2ed605e5c0cd7afc745972e10d5cd17a13e0cb.zip |
added /WINDOW MOVE FIRST and /WINDOW MOVE LAST.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2923 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/core')
-rw-r--r-- | src/fe-common/core/window-commands.c | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/src/fe-common/core/window-commands.c b/src/fe-common/core/window-commands.c index 43629423..f3e56a90 100644 --- a/src/fe-common/core/window-commands.c +++ b/src/fe-common/core/window-commands.c @@ -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; - - if (!is_numeric(data, 0)) { - command_runsub("window move", data, server, item); - return; - } + int refnum; - 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); |