diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-01-15 23:59:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-15 23:59:40 +0100 |
commit | 561df30981461a0e20966839c716f07665b107c0 (patch) | |
tree | b9434752eb6fafca2695c451ab5523d8489f5c65 /src/nvim/api/deprecated.c | |
parent | b455e0179b4288c69e6231bfcf8d1c132b78f2fc (diff) | |
parent | 95ab979fde66d8f9f97fceb943bfe9422739a0f8 (diff) | |
download | rneovim-561df30981461a0e20966839c716f07665b107c0.tar.gz rneovim-561df30981461a0e20966839c716f07665b107c0.tar.bz2 rneovim-561df30981461a0e20966839c716f07665b107c0.zip |
Merge pull request #16836 from bfredl/mark2
refactor(marks): use a more efficient representation with less pointer indirection
Diffstat (limited to 'src/nvim/api/deprecated.c')
-rw-r--r-- | src/nvim/api/deprecated.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/api/deprecated.c b/src/nvim/api/deprecated.c index 76b699800e..18243fec2b 100644 --- a/src/nvim/api/deprecated.c +++ b/src/nvim/api/deprecated.c @@ -130,7 +130,7 @@ Integer nvim_buf_set_virtual_text(Buffer buffer, Integer src_id, Integer line, A return 0; } - uint64_t ns_id = src2ns(&src_id); + uint32_t ns_id = src2ns(&src_id); int width; VirtText virt_text = parse_virt_text(chunks, err, &width); @@ -148,11 +148,12 @@ Integer nvim_buf_set_virtual_text(Buffer buffer, Integer src_id, Integer line, A return src_id; } - Decoration *decor = xcalloc(1, sizeof(*decor)); - decor->virt_text = virt_text; - decor->virt_text_width = width; + Decoration decor = DECORATION_INIT; + decor.virt_text = virt_text; + decor.virt_text_width = width; + decor.priority = 0; - extmark_set(buf, ns_id, NULL, (int)line, 0, -1, -1, decor, true, + extmark_set(buf, ns_id, NULL, (int)line, 0, -1, -1, &decor, true, false, kExtmarkNoUndo); return src_id; } |