Skip to content

Commit

Permalink
fix: don't allow empty scope
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lukas-reineke committed Oct 7, 2024
1 parent 3af6493 commit f3d3ea0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/ibl/scope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f3d3ea0

Please sign in to comment.