summaryrefslogtreecommitdiffstats
path: root/status.c
diff options
context:
space:
mode:
authornicm <nicm>2015-11-13 08:09:28 +0000
committernicm <nicm>2015-11-13 08:09:28 +0000
commitc5689a5a4031a43769b8b721cafa6d1eab6abc44 (patch)
tree8eb234cb05f7934a41365dc0674794ccb34561c5 /status.c
parente71a9154126c7ee853b9a657678de40d475279eb (diff)
Long overdue change to the way we store cells in the grid: now, instead
of storing a full grid_cell with UTF-8 data and everything, store a new type grid_cell_entry. This can either be the cell itself (for ASCII cells), or an offset into an extended array (per line) for UTF-8 data. This avoid a large (8 byte) overhead on non-UTF-8 cells (by far the majority for most users) without the complexity of the shadow array we had before. Grid memory without any UTF-8 is about half. The disadvantage that cells can no longer be modified in place and need to be copied out of the grid and back but it turned out to be lot less complicated than I expected.
Diffstat (limited to 'status.c')
-rw-r--r--status.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/status.c b/status.c
index a4bdf6fa..326e5ad8 100644
--- a/status.c
+++ b/status.c
@@ -746,7 +746,7 @@ status_prompt_redraw(struct client *c)
struct session *s = c->session;
struct screen old_status;
size_t i, size, left, len, off;
- struct grid_cell gc, *gcp;
+ struct grid_cell gc;
if (c->tty.sx == 0 || c->tty.sy == 0)
return (0);
@@ -789,8 +789,9 @@ status_prompt_redraw(struct client *c)
/* Apply fake cursor. */
off = len + c->prompt_index - off;
- gcp = grid_view_get_cell(c->status.grid, off, 0);
- gcp->attr ^= GRID_ATTR_REVERSE;
+ grid_view_get_cell(c->status.grid, off, 0, &gc);
+ gc.attr ^= GRID_ATTR_REVERSE;
+ grid_view_set_cell(c->status.grid, off, 0, &gc);
if (grid_compare(c->status.grid, old_status.grid) == 0) {
screen_free(&old_status);