aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/marktree.h
diff options
context:
space:
mode:
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;