fix(scope): make sure to parse the ts tree. Fixes #521

This commit is contained in:
Folke Lemaitre 2025-01-16 08:37:14 +01:00
parent 9499b944e7
commit 4c55f1c2da
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 7 additions and 2 deletions

View file

@ -400,6 +400,7 @@ function TSScope:find(opts)
if not has_parser or parser == nil then
return
end
parser:parse()
local line = vim.fn.nextnonblank(opts.pos[1])
line = line == 0 and vim.fn.prevnonblank(opts.pos[1]) or line
@ -763,4 +764,7 @@ function M.setup()
end
end
M.TSScope = TSScope
M.IdentScope = IndentScope
return M