Skip to content

Commit

Permalink
fix(builtin.actions): apply refine parser as last parser
Browse files Browse the repository at this point in the history
  • Loading branch information
danielefongo committed Apr 24, 2024
1 parent 1509052 commit b8b98eb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lua/microscope/builtin/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ function actions.refine_with(lens, lens_parser, prompt)
end

microscope:alter(function(opts)
opts.parsers[#opts.parsers + 1] = lens_parser
local new_parsers = {}
for _, parser in ipairs(opts.parsers or {}) do
if not vim.deep_equal(parser, lens_parser) then
table.insert(new_parsers, parser)
end
end
table.insert(new_parsers, lens_parser)

opts.parsers = vim.tbl_values(new_parsers)
opts.lens = lens(lenses.write(current_results))

opts.searches = opts.searches or {}
Expand Down

0 comments on commit b8b98eb

Please sign in to comment.