From f12b1473fde2045d38750aa1051ad624e0fea2bc Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 4 Jan 2020 12:03:04 +0100 Subject: selection: store cell 'selected' state in the cells' attributes Instead of having the renderer calculate, for each cell, whether that cell is currently selected or not, make selection_update() mark/unmark the selected cells. The renderer now only has to look at the cells' 'selected' attribute. This makes the renderer both smaller and faster. --- terminal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index e0b8d44a..4bc4d092 100644 --- a/terminal.h +++ b/terminal.h @@ -41,7 +41,8 @@ struct attributes { uint32_t clean:1; uint32_t have_fg:1; uint32_t have_bg:1; - uint32_t reserved:5; + uint32_t selected:1; + uint32_t reserved:4; uint32_t bg:24; }; static_assert(sizeof(struct attributes) == 8, "bad size"); -- cgit v1.3