bufhl_defs.h
Go to the documentation of this file.
1 #ifndef NVIM_BUFHL_DEFS_H
2 #define NVIM_BUFHL_DEFS_H
3 
4 #include "nvim/pos.h"
5 #include "nvim/lib/kvec.h"
6 #include "nvim/lib/kbtree.h"
7 
8 // bufhl: buffer specific highlighting
9 
10 typedef struct {
11  int src_id;
12  int hl_id; // highlight group
13  colnr_T start; // first column to highlight
14  colnr_T stop; // last column to highlight
15 } BufhlItem;
16 
17 typedef struct {
18  char *text;
19  int hl_id;
21 
22 typedef kvec_t(VirtTextChunk) VirtText;
23 
24 typedef struct {
26  kvec_t(BufhlItem) items;
27  int virt_text_src;
28  VirtText virt_text;
29 } BufhlLine;
30 #define BUFHLLINE_INIT(l) { l, KV_INITIAL_VALUE, 0, KV_INITIAL_VALUE }
31 
32 typedef struct {
34  int current;
37 
38 #define BUFHL_CMP(a, b) ((int)(((a)->line - (b)->line)))
39 KBTREE_INIT(bufhl, BufhlLine *, BUFHL_CMP, 10) // -V512
40 typedef kbtree_t(bufhl) BufhlInfo;
41 #endif // NVIM_BUFHL_DEFS_H
colnr_T stop
Definition: bufhl_defs.h:14
int hl_id
Definition: bufhl_defs.h:12
colnr_T start
Definition: bufhl_defs.h:13
linenr_T line
Definition: bufhl_defs.h:25
int current
Definition: bufhl_defs.h:34
Definition: bufhl_defs.h:24
colnr_T valid_to
Definition: bufhl_defs.h:35
Definition: bufhl_defs.h:10
typedef kvec_t(VirtTextChunk) VirtText
int hl_id
Definition: bufhl_defs.h:19
int colnr_T
Column number type.
Definition: pos.h:9
char * text
Definition: bufhl_defs.h:18
BufhlLine * line
Definition: bufhl_defs.h:33
#define kbtree_t(name)
Definition: kbtree.h:414
long linenr_T
Definition: pos.h:4
Definition: bufhl_defs.h:32
#define BUFHL_CMP(a, b)
Definition: bufhl_defs.h:38
Definition: bufhl_defs.h:17
int src_id
Definition: bufhl_defs.h:11
KBTREE_INIT(bufhl, BufhlLine *, BUFHL_CMP, 10) typedef kbtree_t(bufhl) BufhlInfo