blob: 899fbdf38ad49465e1a7a244fe91cfc3466ba78a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#ifndef NVIM_EXTMARK_DEFS_H
#define NVIM_EXTMARK_DEFS_H
#include "nvim/pos.h" // for colnr_T
#include "nvim/lib/kvec.h"
typedef struct {
char *text;
int hl_id;
} VirtTextChunk;
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;
// 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;
typedef kvec_t(ExtmarkUndoObject) extmark_undo_vec_t;
// Undo/redo extmarks
typedef enum {
kExtmarkNOOP, // Extmarks shouldn't be moved
kExtmarkUndo, // Operation should be reversable/undoable
kExtmarkNoUndo, // Operation should not be reversable
kExtmarkUndoNoRedo, // Operation should be undoable, but not redoable
} ExtmarkOp;
#endif // NVIM_EXTMARK_DEFS_H
|