summaryrefslogtreecommitdiffstats
path: root/cmd-select-window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-10-26 12:29:07 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-10-26 12:29:07 +0000
commit4ba3cf60beea7be93a1de674226f412e5fec1105 (patch)
tree9a86ea8ba56e33233e28217d36446605ddab4be8 /cmd-select-window.c
parent9f06104c3a56ad5ea2070317b776dfa84f213ffb (diff)
Reorg window data structures. Add an intermediate data type (struct winlink) to hold index and make sessions hold a RB tree of them rather than a fixed array.
Diffstat (limited to 'cmd-select-window.c')
-rw-r--r--cmd-select-window.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/cmd-select-window.c b/cmd-select-window.c
index c0633567..9b906ea4 100644
--- a/cmd-select-window.c
+++ b/cmd-select-window.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-select-window.c,v 1.4 2007-10-19 09:21:26 nicm Exp $ */
+/* $Id: cmd-select-window.c,v 1.5 2007-10-26 12:29:07 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -108,10 +108,16 @@ cmd_select_window_exec(void *ptr, struct cmd_ctx *ctx)
if (data == NULL)
return;
- if (session_select(s, data->idx) == 0)
+ switch (session_select(s, data->idx)) {
+ case 0:
server_redraw_session(s);
- else
+ break;
+ case 1:
+ break;
+ default:
ctx->error(ctx, "no window %u", data->idx);
+ break;
+ }
if (!(ctx->flags & CMD_KEY))
server_write_client(c, MSG_EXIT, NULL, 0);