extmark: refiy "Decoration" abstraction

one very important thought
This commit is contained in:
Björn Linse
2020-01-21 13:50:22 +01:00
committed by Thomas Vigouroux
parent 3acfefb63e
commit 54ce1010e8
5 changed files with 157 additions and 135 deletions

View File

@@ -12,14 +12,21 @@ typedef struct {
typedef kvec_t(VirtTextChunk) VirtText;
#define VIRTTEXT_EMPTY ((VirtText)KV_INITIAL_VALUE)
typedef struct
{
int hl_id; // highlight group
VirtText virt_text;
// TODO(bfredl): style, signs, etc
} Decoration;
typedef struct
{
uint64_t ns_id;
uint64_t mark_id;
int hl_id; // highlight group
// TODO(bfredl): virt_text is pretty larger than the rest,
// pointer indirection?
VirtText virt_text;
// TODO(bfredl): a lot of small allocations. Should probably use
// kvec_t(Decoration) as an arena. Alternatively, store ns_id/mark_id
// _inline_ in MarkTree and use the map only for decorations.
Decoration *decor;
} ExtmarkItem;
typedef struct undo_object ExtmarkUndoObject;