aboutsummaryrefslogtreecommitdiff
path: root/cmd-list-windows.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-08-09 17:28:24 +0000
committerTiago Cunha <tcunha@gmx.com>2009-08-09 17:28:24 +0000
commit37b0bcd7c15b6dac69ac8cb1c0d9d6a4fd5c54c0 (patch)
tree7422f55fe913126e060f60cf8c8d892236bc3dd6 /cmd-list-windows.c
parent5b56ea181649793918779dd2684c671072ce4bc9 (diff)
downloadrtmux-37b0bcd7c15b6dac69ac8cb1c0d9d6a4fd5c54c0.tar.gz
rtmux-37b0bcd7c15b6dac69ac8cb1c0d9d6a4fd5c54c0.tar.bz2
rtmux-37b0bcd7c15b6dac69ac8cb1c0d9d6a4fd5c54c0.zip
Sync OpenBSD patchset 226:
Change the way the grid is stored, previously it was: - a two-dimensional array of cells; - a two-dimensional array of utf8 data; - an array of line lengths. Now it is a single array of a new struct grid_line each of which represents a line and contains the length and an array of cells and an array of utf8 data. This will make it easier to add additional per-line members, such as flags.
Diffstat (limited to 'cmd-list-windows.c')
-rw-r--r--cmd-list-windows.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/cmd-list-windows.c b/cmd-list-windows.c
index 635b20f2..e533754e 100644
--- a/cmd-list-windows.c
+++ b/cmd-list-windows.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-list-windows.c,v 1.39 2009-08-08 16:03:09 nicm Exp $ */
+/* $Id: cmd-list-windows.c,v 1.40 2009-08-09 17:28:23 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -48,6 +48,7 @@ cmd_list_windows_exec(struct cmd *self, struct cmd_ctx *ctx)
struct window *w;
struct window_pane *wp;
struct grid *gd;
+ struct grid_line *gl;
u_int i;
unsigned long long size;
const char *name;
@@ -65,11 +66,11 @@ cmd_list_windows_exec(struct cmd *self, struct cmd_ctx *ctx)
size = 0;
for (i = 0; i < gd->hsize; i++) {
- size += gd->size[i] * sizeof **gd->data;
- size += gd->usize[i] * sizeof **gd->udata;
+ gl = &gd->linedata[i];
+ size += gl->cellsize * sizeof *gl->celldata;
+ size += gl->utf8size * sizeof *gl->utf8data;
}
- size += gd->hsize * (sizeof *gd->data);
- size += gd->hsize * (sizeof *gd->size);
+ size += gd->hsize * sizeof *gd->linedata;
name = NULL;
if (wp->fd != -1)