Skip to content

Commit

Permalink
fix: support Query:iter_matches changes in upstream neovim
Browse files Browse the repository at this point in the history
Copied from RRethy#40
  • Loading branch information
brianhuster committed Jan 21, 2025
1 parent 2532be8 commit 1eb6f54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/nvim-treesitter/endwise.lua
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ local function endwise(bufnr)
for _, match, metadata in query:iter_matches(root, bufnr, range[1], range[3] + 1, query_opts) do
local indent_node, cursor_node, endable_node
for id, node in pairs(match) do
if vim.fn.has('nvim-0.11') == 1 then
node = node[#node]
end
if query.captures[id] == 'indent' then
indent_node = node
elseif query.captures[id] == 'cursor' then
Expand Down

0 comments on commit 1eb6f54

Please sign in to comment.