treesitter: use internal "decorations" buffer

This commit is contained in:
Björn Linse
2020-01-17 22:27:17 +01:00
parent 6c5bbf07d9
commit 95fd28f4a1
5 changed files with 49 additions and 81 deletions

View File

@@ -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,8 @@ 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;
decoration_state_add_tmp(attr, start_row, start_col, end_row, end_col);
}