diff --git a/after/queries/lua/matchup.scm b/after/queries/lua/matchup.scm index dcdfae9..0eeec1a 100644 --- a/after/queries/lua/matchup.scm +++ b/after/queries/lua/matchup.scm @@ -1,4 +1,4 @@ -(for_in_statement +(for_statement "do" @open.loop "end" @close.loop) @scope.loop @@ -11,13 +11,10 @@ (if_statement "if" @open.if "end" @close.if) @scope.if -(else "else" @mid.if.1) -(elseif "elseif" @mid.if.2) +(else_statement "else" @mid.if.1) +(elseif_statement "elseif" @mid.if.2) -(function - "function" @open.function - "end" @close.function) @scope.function -(local_function +(function_declaration "function" @open.function "end" @close.function) @scope.function (function_definition diff --git a/lua/treesitter-matchup/third-party/query.lua b/lua/treesitter-matchup/third-party/query.lua index 74c59b7..28d47c0 100644 --- a/lua/treesitter-matchup/third-party/query.lua +++ b/lua/treesitter-matchup/third-party/query.lua @@ -142,9 +142,9 @@ function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row) for id, node in pairs(match) do local name = query.captures[id] -- name of the capture in the query if name ~= nil then - local path = split(name..'.node') + local path = split(name .. ".node") insert_to_path(prepared_match, path, node) - insert_to_path(prepared_match, split(name..'.metadata'), metadata) + insert_to_path(prepared_match, split(name .. '.metadata'), metadata) end end