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
This commit is contained in:
bfredl
2023-03-16 13:56:05 +01:00
parent 320cb344c1
commit 8021300806
9 changed files with 53 additions and 40 deletions

View File

@@ -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;