aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/buffer.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2020-09-04 21:33:25 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2020-09-13 07:46:39 +0200
commit18a3a8982288fc41fd902e412d624071e79fc627 (patch)
treec84646dc84c4b03b9aba2ce9342158d60e19ff62 /src/nvim/api/buffer.c
parent4d3ef578e91cb23586979ed50fa0dfddd45ded1d (diff)
downloadrneovim-18a3a8982288fc41fd902e412d624071e79fc627.tar.gz
rneovim-18a3a8982288fc41fd902e412d624071e79fc627.tar.bz2
rneovim-18a3a8982288fc41fd902e412d624071e79fc627.zip
luahl
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r--src/nvim/api/buffer.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index 15065760b3..e58035b6c7 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -1664,43 +1664,6 @@ void nvim_buf_clear_highlight(Buffer buffer,
nvim_buf_clear_namespace(buffer, ns_id, line_start, line_end, err);
}
-static VirtText parse_virt_text(Array chunks, Error *err)
-{
- VirtText virt_text = KV_INITIAL_VALUE;
- for (size_t i = 0; i < chunks.size; i++) {
- if (chunks.items[i].type != kObjectTypeArray) {
- api_set_error(err, kErrorTypeValidation, "Chunk is not an array");
- goto free_exit;
- }
- Array chunk = chunks.items[i].data.array;
- if (chunk.size == 0 || chunk.size > 2
- || chunk.items[0].type != kObjectTypeString
- || (chunk.size == 2 && chunk.items[1].type != kObjectTypeString)) {
- api_set_error(err, kErrorTypeValidation,
- "Chunk is not an array with one or two strings");
- goto free_exit;
- }
-
- String str = chunk.items[0].data.string;
- char *text = transstr(str.size > 0 ? str.data : ""); // allocates
-
- int hl_id = 0;
- if (chunk.size == 2) {
- String hl = chunk.items[1].data.string;
- if (hl.size > 0) {
- hl_id = syn_check_group((char_u *)hl.data, (int)hl.size);
- }
- }
- kv_push(virt_text, ((VirtTextChunk){ .text = text, .hl_id = hl_id }));
- }
-
- return virt_text;
-
-free_exit:
- clear_virttext(&virt_text);
- return virt_text;
-}
-
/// Set the virtual text (annotation) for a buffer line.
///