summaryrefslogtreecommitdiffstats
path: root/cmd-kill-window.c
authornicm <nicm>2007-10-26 12:29:07 (GMT)
committer nicm <nicm>2007-10-26 12:29:07 (GMT)
commite0a6f7a5e24011293d37c6249d822bddd5bf5880 (patch) (side-by-side diff)
tree08b97ca6be739fa1edc861806f790449315db7e6 /cmd-kill-window.c
parentb06d30c9643ae7da77c2faab3a032ebd7c1a8d1a (diff)
downloadtmux-old-e0a6f7a5e24011293d37c6249d822bddd5bf5880.zip
tmux-old-e0a6f7a5e24011293d37c6249d822bddd5bf5880.tar.gz
tmux-old-e0a6f7a5e24011293d37c6249d822bddd5bf5880.tar.bz2
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-kill-window.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cmd-kill-window.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd-kill-window.c b/cmd-kill-window.c
index 27c47f2..6099d66 100644
--- a/cmd-kill-window.c
+++ b/cmd-kill-window.c
@@ -92,7 +92,7 @@ cmd_kill_window_exec(void *ptr, struct cmd_ctx *ctx)
struct cmd_kill_window_data *data = ptr, std = { -1 };
struct client *c = ctx->client;
struct session *s = ctx->session;
- struct window *w;
+ struct winlink *wl;
u_int i;
int destroyed;
@@ -100,13 +100,13 @@ cmd_kill_window_exec(void *ptr, struct cmd_ctx *ctx)
data = &std;
if (data->idx == -1)
- w = s->window;
- else if ((w = window_at(&s->windows, data->idx)) == NULL) {
+ wl = s->curw;
+ else if ((wl = winlink_find_by_index(&s->windows, data->idx)) == NULL) {
ctx->error(ctx, "no window %u", data->idx);
return;
}
- destroyed = session_detach(s, w);
+ destroyed = session_detach(s, wl);
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
c = ARRAY_ITEM(&clients, i);
if (c == NULL || c->session != s)