Fix scopes comparator

This commit is contained in:
hrsh7th
2022-04-20 13:20:51 +09:00
parent 07132dc597
commit f9f6d8dc49

View File

@@ -204,7 +204,7 @@ compare.scopes = setmetatable({
for _, definition in pairs(definitions) do for _, definition in pairs(definitions) do
if s <= definition.node:start() and definition.node:end_() <= e then if s <= definition.node:start() and definition.node:end_() <= e then
if scope:id() == locals.containing_scope(definition.node, buf):id() then if scope:id() == locals.containing_scope(definition.node, buf):id() then
local text = vim.treesitter.query.get_node_text(definition.node)[1] local text = vim.treesitter.query.get_node_text(definition.node, buf) or ''
if not self.scopes_map[text] then if not self.scopes_map[text] then
self.scopes_map[text] = depth self.scopes_map[text] = depth
end end