aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/buffer.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2020-11-07 09:24:00 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2020-11-07 09:55:17 +0100
commit8497d4b3ea9822cfb4d2bf2437997e837fd4827c (patch)
treedc35be5a218677b4a927fd08d3d28a7e1fb1d9fa /src/nvim/api/buffer.c
parentda134270d3e9f8a4824b0e0540bf017f7e59b06e (diff)
downloadrneovim-8497d4b3ea9822cfb4d2bf2437997e837fd4827c.tar.gz
rneovim-8497d4b3ea9822cfb4d2bf2437997e837fd4827c.tar.bz2
rneovim-8497d4b3ea9822cfb4d2bf2437997e837fd4827c.zip
decoration: split out "decoration" from "extmark" module
Decorations will only grow more complex. move the to a separate file, so that extmark.c remains about extmarks.
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r--src/nvim/api/buffer.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index 4569ebc713..4fc0ee4fdf 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -28,6 +28,7 @@
#include "nvim/map.h"
#include "nvim/mark.h"
#include "nvim/extmark.h"
+#include "nvim/decoration.h"
#include "nvim/fileio.h"
#include "nvim/move.h"
#include "nvim/syntax.h"
@@ -1470,15 +1471,15 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id,
}
// TODO(bfredl): synergize these two branches even more
- if (ephemeral && redrawn_win && redrawn_win->w_buffer == buf) {
+ if (ephemeral && decor_state.buf == buf) {
int attr_id = hl_id > 0 ? syn_id2attr(hl_id) : 0;
VirtText *vt_allocated = NULL;
if (kv_size(virt_text)) {
vt_allocated = xmalloc(sizeof *vt_allocated);
*vt_allocated = virt_text;
}
- decorations_add_ephemeral(attr_id, (int)line, (colnr_T)col,
- (int)line2, (colnr_T)col2, vt_allocated);
+ decor_add_ephemeral(attr_id, (int)line, (colnr_T)col,
+ (int)line2, (colnr_T)col2, vt_allocated);
} else {
if (ephemeral) {
api_set_error(err, kErrorTypeException, "not yet implemented");
@@ -1490,7 +1491,7 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id,
decor->hl_id = hl_id;
decor->virt_text = virt_text;
} else if (hl_id) {
- decor = decoration_hl(hl_id);
+ decor = decor_hl(hl_id);
}
id = extmark_set(buf, (uint64_t)ns_id, id, (int)line, (colnr_T)col,
@@ -1609,7 +1610,7 @@ Integer nvim_buf_add_highlight(Buffer buffer,
extmark_set(buf, ns_id, 0,
(int)line, (colnr_T)col_start,
end_line, (colnr_T)col_end,
- decoration_hl(hl_id), kExtmarkNoUndo);
+ decor_hl(hl_id), kExtmarkNoUndo);
return src_id;
}
@@ -1728,7 +1729,7 @@ Integer nvim_buf_set_virtual_text(Buffer buffer,
}
- VirtText *existing = extmark_find_virttext(buf, (int)line, ns_id);
+ VirtText *existing = decor_find_virttext(buf, (int)line, ns_id);
if (existing) {
clear_virttext(existing);