diff --git a/lua/ibl/init.lua b/lua/ibl/init.lua index 0d3333e..85c41fc 100644 --- a/lua/ibl/init.lua +++ b/lua/ibl/init.lua @@ -244,6 +244,7 @@ M.refresh = function(bufnr) local scope_row_start, scope_col_start, scope_row_end, scope_col_end = -1, -1, -1, -1 local scope_index = -1 if scope then + ---@diagnostic disable-next-line: cast-local-type scope_row_start, scope_col_start, scope_row_end, scope_col_end = scope:range() scope_row_start, scope_col_start, scope_row_end = scope_row_start + 1, scope_col_start + 1, scope_row_end + 1 end diff --git a/lua/ibl/scope.lua b/lua/ibl/scope.lua index 122c170..2e7dcfe 100644 --- a/lua/ibl/scope.lua +++ b/lua/ibl/scope.lua @@ -72,7 +72,7 @@ M.get = function(bufnr, config) local include_node_types = utils.tbl_join(config.scope.include.node_type["*"] or {}, config.scope.include.node_type[lang] or {}) - while node do + while node and node:byte_length() > 0 do local type = node:type() if