aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vim.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2020-02-10 18:09:50 +0100
committerGitHub <noreply@github.com>2020-02-10 18:09:50 +0100
commita723d605490567c9e9cf961aa85b80e8a729db1e (patch)
tree3d6ccec65f486382fc8ef6caf60781a131ea0271 /src/nvim/api/vim.c
parent6c5bbf07d988ef55e5e8ba8d70b62c1f0885261b (diff)
parent7d7adf7acc0d4f5219e1fc433d26c6c6c30b46fc (diff)
downloadrneovim-a723d605490567c9e9cf961aa85b80e8a729db1e.tar.gz
rneovim-a723d605490567c9e9cf961aa85b80e8a729db1e.tar.bz2
rneovim-a723d605490567c9e9cf961aa85b80e8a729db1e.zip
Merge pull request #11842 from bfredl/decotest
treesitter: use internal "decorations" buffer
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r--src/nvim/api/vim.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 30fc48fea5..cf18f6b19a 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -2598,7 +2598,8 @@ Array nvim__inspect_cell(Integer grid, Integer row, Integer col, Error *err)
/// interface should probably be derived from a reformed
/// bufhl/virttext interface with full support for multi-line
/// ranges etc
-void nvim__put_attr(Integer id, Integer c0, Integer c1)
+void nvim__put_attr(Integer id, Integer start_row, Integer start_col,
+ Integer end_row, Integer end_col)
FUNC_API_LUA_ONLY
{
if (!lua_attr_active) {
@@ -2608,10 +2609,9 @@ void nvim__put_attr(Integer id, Integer c0, Integer c1)
return;
}
int attr = syn_id2attr((int)id);
- c0 = MAX(c0, 0);
- c1 = MIN(c1, (Integer)lua_attr_bufsize);
- for (Integer c = c0; c < c1; c++) {
- lua_attr_buf[c] = (sattr_T)hl_combine_attr(lua_attr_buf[c], (int)attr);
+ if (attr == 0) {
+ return;
}
- return;
+ decorations_add_luahl_attr(attr, (int)start_row, (colnr_T)start_col,
+ (int)end_row, (colnr_T)end_col);
}