feat(luahl): add priority mechanism

Base priority is 0x1000, in order to stay kinda backward compatible.
Also set tree-sitter default highlight to 100 (middle-ish value)
This commit is contained in:
Thomas Vigouroux
2020-11-23 12:25:36 +01:00
parent 43ec616414
commit c0a6989d93
5 changed files with 125 additions and 15 deletions

View File

@@ -15,11 +15,15 @@ typedef struct {
typedef kvec_t(VirtTextChunk) VirtText;
#define VIRTTEXT_EMPTY ((VirtText)KV_INITIAL_VALUE)
typedef uint16_t DecorPriority;
#define DECOR_PRIORITY_BASE 0x1000
struct Decoration
{
int hl_id; // highlight group
VirtText virt_text;
// TODO(bfredl): style, signs, etc
DecorPriority priority;
bool shared; // shared decoration, don't free
};
@@ -29,6 +33,7 @@ typedef struct {
int end_row;
int end_col;
int attr_id;
DecorPriority priority;
VirtText *virt_text;
bool virt_text_owned;
} HlRange;