Neovim Home
src
nvim
extmark.h
Go to the documentation of this file.
1
#ifndef NVIM_EXTMARK_H
2
#define NVIM_EXTMARK_H
3
4
#include "
nvim/buffer_defs.h
"
5
#include "
nvim/decoration.h
"
6
#include "
nvim/extmark_defs.h
"
7
#include "
nvim/marktree.h
"
8
#include "
nvim/pos.h
"
9
10
EXTERN
int
extmark_splice_pending
INIT
(= 0);
11
12
typedef
struct
{
13
uint64_t
ns_id
;
14
uint64_t
mark_id
;
15
int
row
;
16
colnr_T
col
;
17
int
end_row
;
18
colnr_T
end_col
;
19
bool
right_gravity
;
20
bool
end_right_gravity
;
21
Decoration
decor
;
// TODO(bfredl): CHONKY
22
}
ExtmarkInfo
;
23
24
typedef
kvec_t
(
ExtmarkInfo
) ExtmarkInfoArray;
25
26
// TODO(bfredl): good enough name for now.
27
typedef
ptrdiff_t
bcount_t
;
28
29
30
// delete the columns between mincol and endcol
31
typedef
struct
{
32
int
start_row
;
33
colnr_T
start_col
;
34
int
old_row
;
35
colnr_T
old_col
;
36
int
new_row
;
37
colnr_T
new_col
;
38
bcount_t
start_byte
;
39
bcount_t
old_byte
;
40
bcount_t
new_byte
;
41
}
ExtmarkSplice
;
42
43
// adjust marks after :move operation
44
typedef
struct
{
45
int
start_row
;
46
int
start_col
;
47
int
extent_row
;
48
int
extent_col
;
49
int
new_row
;
50
int
new_col
;
51
bcount_t
start_byte
;
52
bcount_t
extent_byte
;
53
bcount_t
new_byte
;
54
}
ExtmarkMove
;
55
56
// extmark was updated
57
typedef
struct
{
58
uint64_t
mark
;
// raw mark id of the marktree
59
int
old_row
;
60
colnr_T
old_col
;
61
int
row
;
62
colnr_T
col
;
63
}
ExtmarkSavePos
;
64
65
typedef
enum
{
66
kExtmarkSplice
,
67
kExtmarkMove
,
68
kExtmarkUpdate
,
69
kExtmarkSavePos
,
70
kExtmarkClear
,
71
}
UndoObjectType
;
72
73
// TODO(bfredl): reduce the number of undo action types
74
struct
undo_object
{
75
UndoObjectType
type
;
76
union
{
77
ExtmarkSplice
splice
;
78
ExtmarkMove
move
;
79
ExtmarkSavePos
savepos
;
80
}
data
;
81
};
82
83
84
#ifdef INCLUDE_GENERATED_DECLARATIONS
85
# include "extmark.h.generated.h"
86
#endif
87
88
#endif // NVIM_EXTMARK_H
ExtmarkMove::start_col
int start_col
Definition:
extmark.h:46
ExtmarkInfo::mark_id
uint64_t mark_id
Definition:
extmark.h:14
undo_object::data
union undo_object::@42 data
kvec_t
typedef kvec_t(ExtmarkInfo) ExtmarkInfoArray
ExtmarkInfo::end_right_gravity
bool end_right_gravity
Definition:
extmark.h:20
undo_object::savepos
ExtmarkSavePos savepos
Definition:
extmark.h:79
ExtmarkSplice::start_row
int start_row
Definition:
extmark.h:32
ExtmarkMove::new_byte
bcount_t new_byte
Definition:
extmark.h:53
ExtmarkSplice::new_byte
bcount_t new_byte
Definition:
extmark.h:40
ExtmarkSplice
Definition:
extmark.h:31
ExtmarkMove::extent_byte
bcount_t extent_byte
Definition:
extmark.h:52
ExtmarkMove::new_row
int new_row
Definition:
extmark.h:49
ExtmarkMove
Definition:
extmark.h:44
UndoObjectType
UndoObjectType
Definition:
extmark.h:65
marktree.h
ExtmarkSavePos::col
colnr_T col
Definition:
extmark.h:62
ExtmarkSavePos::old_col
colnr_T old_col
Definition:
extmark.h:60
ExtmarkSavePos::mark
uint64_t mark
Definition:
extmark.h:58
ExtmarkInfo::end_row
int end_row
Definition:
extmark.h:17
ExtmarkInfo
Definition:
extmark.h:12
ExtmarkSavePos
Definition:
extmark.h:57
ExtmarkMove::start_byte
bcount_t start_byte
Definition:
extmark.h:51
ExtmarkInfo::decor
Decoration decor
Definition:
extmark.h:21
ExtmarkSplice::start_byte
bcount_t start_byte
Definition:
extmark.h:38
kExtmarkMove
@ kExtmarkMove
Definition:
extmark.h:67
bcount_t
ptrdiff_t bcount_t
Definition:
extmark.h:27
colnr_T
int colnr_T
Column number type.
Definition:
pos.h:10
kExtmarkSavePos
@ kExtmarkSavePos
Definition:
extmark.h:69
undo_object::move
ExtmarkMove move
Definition:
extmark.h:78
ExtmarkSavePos::row
int row
Definition:
extmark.h:61
undo_object::splice
ExtmarkSplice splice
Definition:
extmark.h:77
ExtmarkMove::new_col
int new_col
Definition:
extmark.h:50
kExtmarkClear
@ kExtmarkClear
Definition:
extmark.h:70
ExtmarkInfo::end_col
colnr_T end_col
Definition:
extmark.h:18
ExtmarkMove::start_row
int start_row
Definition:
extmark.h:45
ExtmarkInfo::col
colnr_T col
Definition:
extmark.h:16
undo_object::type
UndoObjectType type
Definition:
extmark.h:75
ExtmarkSplice::new_row
int new_row
Definition:
extmark.h:36
kExtmarkUpdate
@ kExtmarkUpdate
Definition:
extmark.h:68
ExtmarkMove::extent_row
int extent_row
Definition:
extmark.h:47
ExtmarkSplice::old_row
int old_row
Definition:
extmark.h:34
ExtmarkSplice::old_col
colnr_T old_col
Definition:
extmark.h:35
extmark_defs.h
ExtmarkInfo::row
int row
Definition:
extmark.h:15
decoration.h
INIT
EXTERN handle_T next_namespace_id INIT(=1)
PROF_ values.
EXTERN
#define EXTERN
Definition:
macros.h:9
ExtmarkSplice::start_col
colnr_T start_col
Definition:
extmark.h:33
ExtmarkInfo::ns_id
uint64_t ns_id
Definition:
extmark.h:13
ExtmarkMove::extent_col
int extent_col
Definition:
extmark.h:48
ExtmarkInfo::right_gravity
bool right_gravity
Definition:
extmark.h:19
undo_object
Definition:
extmark.h:74
ExtmarkSplice::new_col
colnr_T new_col
Definition:
extmark.h:37
buffer_defs.h
ExtmarkSavePos::old_row
int old_row
Definition:
extmark.h:59
kExtmarkSplice
@ kExtmarkSplice
Definition:
extmark.h:66
ExtmarkSplice::old_byte
bcount_t old_byte
Definition:
extmark.h:39
Decoration
Definition:
decoration.h:38
pos.h