Skip to content

Commit

Permalink
Merge pull request #48 from desdic/neovim0.11
Browse files Browse the repository at this point in the history
fix: iter_matches() changed
  • Loading branch information
desdic authored Sep 24, 2024
2 parents 75d4c0d + bc9e754 commit 8d1e4fd
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions lua/agrolens/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,29 @@ M.add_entries = function(
local iter_query =
vim.treesitter.query.get(filetype, "agrolens." .. capture_name)
if iter_query then
for _, matches, _ in iter_query:iter_matches(root, bufnr) do
local entry = M.create_entry(
filename,
relfilename,
matches,
iter_query,
bufnr,
capture_name
)

if opts.disable_indentation then
entry.line = utils.all_trim(entry.line)
end
for _, matches, _ in
iter_query:iter_matches(root, bufnr, 0, -1, { all = false })
do
if matches ~= nil then
local entry = M.create_entry(
filename,
relfilename,
matches,
iter_query,
bufnr,
capture_name
)

if opts.disable_indentation then
entry.line = utils.all_trim(entry.line)
end

local formated_entry = utils.format_entry(entry)
if not dublicates[formated_entry] then
dublicates[formated_entry] = true
if M.does_match(opts, entry) then
table.insert(entries, entry)
local formated_entry = utils.format_entry(entry)
if not dublicates[formated_entry] then
dublicates[formated_entry] = true
if M.does_match(opts, entry) then
table.insert(entries, entry)
end
end
end
end
Expand Down

0 comments on commit 8d1e4fd

Please sign in to comment.