From 294f63a0c1898843aa367aa83d0878046caf035f Mon Sep 17 00:00:00 2001 From: Philippe Massicotte Date: Sun, 23 Feb 2025 08:07:56 -0500 Subject: [PATCH] fix(send.lua): adjust iteration range in call_query to focus on current line Change the iteration range in the `call_query:iter_captures` function to only process the current line, improving performance and accuracy by limiting the scope to the cursor's position. --- lua/r/send.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/r/send.lua b/lua/r/send.lua index 2216b1e1..fbd9ab40 100644 --- a/lua/r/send.lua +++ b/lua/r/send.lua @@ -716,7 +716,7 @@ M.chain = function() local sibling = nil local visited = false - for id, node, _ in call_query:iter_captures(pipe_block_node, bufnr, 0, -1) do + for id, node, _ in call_query:iter_captures(root, bufnr, cursor_row, cursor_row + 1) do local capture_name = call_query.captures[id] local start_row, _, end_row = node:range()