Skip to content

Commit

Permalink
fix(send.lua): adjust iteration range in call_query to focus on curre…
Browse files Browse the repository at this point in the history
…nt 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.
  • Loading branch information
PMassicotte committed Feb 23, 2025
1 parent ad23ef9 commit 294f63a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/r/send.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 294f63a

Please sign in to comment.