diff options
-rw-r--r-- | src/nvim/api/vim.c | 2 | ||||
-rw-r--r-- | src/nvim/decoration.c | 4 | ||||
-rw-r--r-- | src/nvim/marktree.c | 68 |
3 files changed, 37 insertions, 37 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 5050f1842d..6501ae2c89 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -805,7 +805,7 @@ ArrayOf(String) nvim_get_runtime_file(String name, Boolean all, Error *err) } int flags = DIP_START | (all ? DIP_ALL : 0); - do_in_runtimepath(name.size ? (char_u *)name.data : NULL, + do_in_runtimepath((char_u *)name.data, flags, find_runtime_cb, &rv); return rv; } diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c index d411f22e7a..0721c0c57b 100644 --- a/src/nvim/decoration.c +++ b/src/nvim/decoration.c @@ -182,7 +182,7 @@ bool decor_redraw_start(buf_T *buf, int top_row, DecorState *state) Decoration *decor = item->decor; if ((!(mark.id&MARKTREE_END_FLAG) && altpos.row < top_row - && item && !kv_size(decor->virt_text)) + && !kv_size(decor->virt_text)) || ((mark.id&MARKTREE_END_FLAG) && altpos.row >= top_row)) { goto next_mark; } @@ -251,7 +251,7 @@ int decor_redraw_col(buf_T *buf, int col, DecorState *state) if (endpos.row < mark.row || (endpos.row == mark.row && endpos.col <= mark.col)) { - if (item && !kv_size(decor->virt_text)) { + if (!kv_size(decor->virt_text)) { goto next_mark; } } diff --git a/src/nvim/marktree.c b/src/nvim/marktree.c index 6dd452b5af..e9ea2cbba9 100644 --- a/src/nvim/marktree.c +++ b/src/nvim/marktree.c @@ -326,38 +326,37 @@ void marktree_del_itr(MarkTree *b, MarkTreeIter *itr, bool rev) x->n--; // 4. - if (adjustment) { - if (adjustment == 1) { - abort(); - } else { // adjustment == -1 - int ilvl = itr->lvl-1; - mtnode_t *lnode = x; - do { - mtnode_t *p = lnode->parent; - if (ilvl < 0) { - abort(); - } - int i = itr->s[ilvl].i; - assert(p->ptr[i] == lnode); - if (i > 0) { - unrelative(p->key[i-1].pos, &intkey.pos); - } - lnode = p; - ilvl--; - } while (lnode != cur); - - mtkey_t deleted = cur->key[curi]; - cur->key[curi] = intkey; - refkey(b, cur, curi); - relative(intkey.pos, &deleted.pos); - mtnode_t *y = cur->ptr[curi+1]; - if (deleted.pos.row || deleted.pos.col) { - while (y) { - for (int k = 0; k < y->n; k++) { - unrelative(deleted.pos, &y->key[k].pos); - } - y = y->level ? y->ptr[0] : NULL; + // if (adjustment == 1) { + // abort(); + // } + if (adjustment == -1) { + int ilvl = itr->lvl-1; + const mtnode_t *lnode = x; + do { + const mtnode_t *const p = lnode->parent; + if (ilvl < 0) { + abort(); + } + const int i = itr->s[ilvl].i; + assert(p->ptr[i] == lnode); + if (i > 0) { + unrelative(p->key[i-1].pos, &intkey.pos); + } + lnode = p; + ilvl--; + } while (lnode != cur); + + mtkey_t deleted = cur->key[curi]; + cur->key[curi] = intkey; + refkey(b, cur, curi); + relative(intkey.pos, &deleted.pos); + mtnode_t *y = cur->ptr[curi+1]; + if (deleted.pos.row || deleted.pos.col) { + while (y) { + for (int k = 0; k < y->n; k++) { + unrelative(deleted.pos, &y->key[k].pos); } + y = y->level ? y->ptr[0] : NULL; } } } @@ -435,9 +434,10 @@ void marktree_del_itr(MarkTree *b, MarkTreeIter *itr, bool rev) // BONUS STEP: fix the iterator, so that it points to the key afterwards // TODO(bfredl): with "rev" should point before - if (adjustment == 1) { - abort(); - } else if (adjustment == -1) { + // if (adjustment == 1) { + // abort(); + // } + if (adjustment == -1) { // tricky: we stand at the deleted space in the previous leaf node. // But the inner key is now the previous key we stole, so we need // to skip that one as well. |