aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-01-06 10:56:18 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-01-06 10:56:18 +0000
commit457eb573c441826d4b3843c6c0ad36de097f17d7 (patch)
treebc99f800f6ca2d19a1bc51e905be049e81dbc194 /terminal.h
parentselection: foreach_selection_*: must wrap row number (diff)
selection: update: don't dirty cells that don't change state
Previously when updating a selection, we would unmark *all* cells in the old selection, and then mark all cells in the new selection. This caused *all* cells to be dirtied and thus re-rendered. Avoid this, by adding a temporary state to the cells' selected state. Before unmarking the old selection, pre-mark the new selection using a temporary state. When unmarking the old selection, ignore cells in this temporary state. When marking the new selection, ignore cells in this temporary state (except clearing the temporary state).
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/terminal.h b/terminal.h
index ae3ece01..1595f902 100644
--- a/terminal.h
+++ b/terminal.h
@@ -41,8 +41,8 @@ struct attributes {
uint32_t clean:1;
uint32_t have_fg:1;
uint32_t have_bg:1;
- uint32_t selected:1;
- uint32_t reserved:4;
+ uint32_t selected:2;
+ uint32_t reserved:3;
uint32_t bg:24;
};
static_assert(sizeof(struct attributes) == 8, "bad size");