aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/marktree.h
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-03-16 13:56:05 +0100
committerbfredl <bjorn.linse@gmail.com>2023-03-16 13:56:05 +0100
commit8021300806e2ccf04b3ec33970b682ee3c7a9cc3 (patch)
treecd4b6ed77b3f0cfc8ba57466d7a871920116f1d4 /src/nvim/marktree.h
parent320cb344c14b30f8c1aa8c2d86803e4c2f971ae9 (diff)
downloadrneovim-8021300806e2ccf04b3ec33970b682ee3c7a9cc3.tar.gz
rneovim-8021300806e2ccf04b3ec33970b682ee3c7a9cc3.tar.bz2
rneovim-8021300806e2ccf04b3ec33970b682ee3c7a9cc3.zip
refactor(extmarks): some minor internal API changes
extranges and a bunch of other improvements are coming for 0.10 This gets in some minor surrounding API changes to avoid rebase conflicts until then. - decorations will be able to be specific to windows - adjust deletion API to fit with extranges
Diffstat (limited to 'src/nvim/marktree.h')
-rw-r--r--src/nvim/marktree.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/nvim/marktree.h b/src/nvim/marktree.h
index 5ce4b2cd24..046946bc95 100644
--- a/src/nvim/marktree.h
+++ b/src/nvim/marktree.h
@@ -22,21 +22,26 @@ typedef struct {
int32_t row;
int32_t col;
} mtpos_t;
+#define mtpos_t(r, c) ((mtpos_t){ .row = (r), .col = (c) })
typedef struct mtnode_s mtnode_t;
-typedef struct {
- int oldcol;
- int i;
-} iterstate_t;
typedef struct {
mtpos_t pos;
int lvl;
mtnode_t *node;
int i;
- iterstate_t s[MT_MAX_DEPTH];
+ struct {
+ int oldcol;
+ int i;
+ } s[MT_MAX_DEPTH];
+
+ size_t intersect_idx;
+ mtpos_t intersect_pos;
} MarkTreeIter;
+#define marktree_itr_valid(itr) ((itr)->node != NULL)
+
// Internal storage
//
// NB: actual marks have flags > 0, so we can use (row,col,0) pseudo-key for
@@ -123,8 +128,6 @@ struct mtnode_s {
mtnode_t *ptr[];
};
-// TODO(bfredl): the iterator is pretty much everpresent, make it part of the
-// tree struct itself?
typedef struct {
mtnode_t *root;
size_t n_keys, n_nodes;