ui/tui: highlighting refactor

Make HlAttr contain highlighting state for both color modes (cterm and rgb).
This allows us to implement termguicolors completely in the TUI.

Simplify some logic duplicated between ui.c and screen.c. Also avoid
some superfluous highlighting reset events.
This commit is contained in:
Björn Linse
2018-02-06 19:46:45 +01:00
parent c205360f00
commit 5d8da126d0
18 changed files with 195 additions and 289 deletions

View File

@@ -7,15 +7,17 @@
typedef struct ucell UCell;
typedef struct ugrid UGrid;
#define CELLBYTES (4 * (MAX_MCO+1))
struct ucell {
char data[6 * MAX_MCO + 1];
char data[CELLBYTES + 1];
HlAttrs attrs;
};
struct ugrid {
int top, bot, left, right;
int row, col;
int bg, fg;
HlAttrs clear_attrs;
int width, height;
HlAttrs attrs;
UCell **cells;