Skip to content

Commit f3d3ea0

Browse files
committed
fix: don't allow empty scope
There seems to be a bug in treesitter that allows an infinite loop of node parents, if the node is empty. IBL doesn't care about the node if it's empty anyway, so we can just ignore them. fix #930
1 parent 3af6493 commit f3d3ea0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/ibl/scope.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ M.get = function(bufnr, config)
7272
local include_node_types =
7373
utils.tbl_join(config.scope.include.node_type["*"] or {}, config.scope.include.node_type[lang] or {})
7474

75-
while node do
75+
while node and node:byte_length() > 0 do
7676
local type = node:type()
7777

7878
if

0 commit comments

Comments
 (0)