ui: use line-based rather than char-based updates in screen.c

Add ext_newgrid and ext_hlstate extensions. These use predefined
highlights and line-segment based updates, for efficiency and
simplicity.. The ext_hlstate extension in addition allows semantic
identification of builtin and syntax highlights.

Reimplement the old char-based updates in the remote UI layer, for
compatibility. For the moment, this is still the default. The bulitin
TUI uses the new line-based protocol.

cmdline uses curwin cursor position when ext_cmdline is active.
This commit is contained in:
Björn Linse
2018-07-06 14:39:50 +02:00
parent 2134396074
commit 1adb01c120
28 changed files with 979 additions and 576 deletions

View File

@@ -8,6 +8,8 @@
typedef int32_t RgbValue;
/// Highlighting attribute bits.
///
/// sign bit should not be used here, as it identifies invalid highlight
typedef enum {
HL_INVERSE = 0x01,
HL_BOLD = 0x02,
@@ -35,6 +37,17 @@ typedef struct attr_entry {
.cterm_bg_color = 0, \
}
// sentinel value that compares unequal to any valid highlight
#define HLATTRS_INVALID (HlAttrs) { \
.rgb_ae_attr = -1, \
.cterm_ae_attr = -1, \
.rgb_fg_color = -1, \
.rgb_bg_color = -1, \
.rgb_sp_color = -1, \
.cterm_fg_color = 0, \
.cterm_bg_color = 0, \
}
/// Values for index in highlight_attr[].
/// When making changes, also update hlf_names below!
typedef enum {