feat(decorations): support more than one virt_lines block

This commit is contained in:
Björn Linse
2021-10-13 21:35:37 +02:00
parent 8ade2f5b04
commit 8d7816cf27
13 changed files with 130 additions and 106 deletions

View File

@@ -901,15 +901,15 @@ if (h->n_buckets < new_n_buckets) { // expand
screen:expect{grid=[[
if (h->n_buckets < new_n_buckets) { // expand |
khkey_t *new_keys = (khkey_t *) |
{1:>> }{2:krealloc}: change the size of an allocation |
{3:krealloc}((void *)h->keys, new_n_buckets * sizeof(k|
hkey_t)); |
h->keys = new_keys; |
if (kh_is_map && val_size) { |
char *new_vals = {3:krealloc}( h->vals_buf, new_n_|
buck^ets * val_size); |
^char *new_vals = {3:krealloc}( h->vals_buf, new_n_|
buckets * val_size); |
{5:^^ REVIEW:}{6: new_vals variable seems unneccesary?} |
h->vals_buf = new_vals; |
} |
|
]]}
@@ -1235,6 +1235,7 @@ if (h->n_buckets < new_n_buckets) { // expand
|
]]}
meths.buf_clear_namespace(0, ns, 0, -1)
meths.buf_set_extmark(0, ns, 2, 0, {
virt_lines={
{{"Some special", "Special"}};

View File

@@ -97,7 +97,7 @@ describe('marktree', function()
for i = 1,100 do
for j = 1,100 do
local gravitate = (i%2) > 0
local id = tonumber(lib.marktree_put(tree, j, i, gravitate))
local id = tonumber(lib.marktree_put(tree, j, i, gravitate, 0))
ok(id > 0)
eq(nil, shadow[id])
shadow[id] = {j,i,gravitate}
@@ -191,7 +191,7 @@ describe('marktree', function()
-- https://github.com/neovim/neovim/pull/14719
lib.marktree_clear(tree)
for i = 1,20 do
lib.marktree_put(tree, i, i, false)
lib.marktree_put(tree, i, i, false, 0)
end
lib.marktree_itr_get(tree, 10, 10, iter)