From 143aa718e5958b9c7b539657d02c476a43270dad Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 4 May 2009 17:58:27 +0000 Subject: Space trimmage mega-diff. --- cmd-find-window.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'cmd-find-window.c') diff --git a/cmd-find-window.c b/cmd-find-window.c index a597582a..a3a4a51b 100644 --- a/cmd-find-window.c +++ b/cmd-find-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-find-window.c,v 1.6 2009-03-29 11:18:28 nicm Exp $ */ +/* $Id: cmd-find-window.c,v 1.7 2009-05-04 17:58:26 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -70,7 +70,7 @@ cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx) if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL) return (-1); - + ARRAY_INIT(&list_idx); ARRAY_INIT(&list_ctx); @@ -86,7 +86,7 @@ cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx) if (sres == NULL && strstr(wp->base.title, data->arg) == NULL) continue; - + if (sres == NULL) { xasprintf(&sctx, "pane %u title: \"%s\"", i - 1, @@ -96,9 +96,9 @@ cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx) xfree(sres); } } - + ARRAY_ADD(&list_idx, wm->idx); - ARRAY_ADD(&list_ctx, sctx); + ARRAY_ADD(&list_ctx, sctx); } } @@ -123,7 +123,7 @@ cmd_find_window_exec(struct cmd *self, struct cmd_ctx *ctx) wm = winlink_find_by_index( &s->windows, ARRAY_ITEM(&list_idx, i)); w = wm->window; - + sctx = ARRAY_ITEM(&list_ctx, i); window_choose_add(wl->window->active, wm->idx, "%3d: %s [%ux%u] (%u panes) %s", wm->idx, w->name, @@ -170,7 +170,7 @@ cmd_find_window_search(struct window_pane *wp, const char *searchstr) u_int i, j, k; buf = xmalloc(1); - + for (j = 0; j < screen_size_y(&wp->base); j++) { off = 0; for (i = 0; i < screen_size_x(&wp->base); i++) { @@ -191,7 +191,7 @@ cmd_find_window_search(struct window_pane *wp, const char *searchstr) while (off > 0 && buf[off - 1] == ' ') off--; buf[off] = '\0'; - + if ((s = strstr(buf, searchstr)) != NULL) { s = section_string(buf, off, s - buf, 40); xfree(buf); -- cgit