Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default entry_maker not set properly #2116

Merged
merged 1 commit into from
Aug 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update finders.lua
make_entry.gen_from_string is entry_maker factory
  • Loading branch information
mnowotnik authored and Conni2461 committed Aug 13, 2022
commit 45c5c597f74382c187537c56b50dc201faf49000
6 changes: 3 additions & 3 deletions lua/telescope/finders.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function JobFinder:new(opts)
assert(not opts.static, "`static` should be used with finder.new_oneshot_job")

local obj = setmetatable({
entry_maker = opts.entry_maker or make_entry.gen_from_string,
entry_maker = opts.entry_maker or make_entry.gen_from_string(opts),
fn_command = opts.fn_command,
cwd = opts.cwd,
writer = opts.writer,
Expand Down Expand Up @@ -122,7 +122,7 @@ function DynamicFinder:new(opts)
local obj = setmetatable({
curr_buf = opts.curr_buf,
fn = opts.fn,
entry_maker = opts.entry_maker or make_entry.gen_from_string,
entry_maker = opts.entry_maker or make_entry.gen_from_string(opts),
}, self)

return obj
Expand Down Expand Up @@ -180,7 +180,7 @@ finders.new_oneshot_job = function(command_list, opts)
local command = table.remove(command_list, 1)

return async_oneshot_finder {
entry_maker = opts.entry_maker or make_entry.gen_from_string(),
entry_maker = opts.entry_maker or make_entry.gen_from_string(opts),

cwd = opts.cwd,
maximum_results = opts.maximum_results,
Expand Down
2 changes: 1 addition & 1 deletion lua/telescope/finders/async_job_finder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local log = require "telescope.log"

return function(opts)
log.trace("Creating async_job:", opts)
local entry_maker = opts.entry_maker or make_entry.gen_from_string()
local entry_maker = opts.entry_maker or make_entry.gen_from_string(opts)

local fn_command = function(prompt)
local command_list = opts.command_generator(prompt)
Expand Down
2 changes: 1 addition & 1 deletion lua/telescope/finders/async_oneshot_finder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local await_count = 1000
return function(opts)
opts = opts or {}

local entry_maker = opts.entry_maker or make_entry.gen_from_string
local entry_maker = opts.entry_maker or make_entry.gen_from_string(opts)
local cwd = opts.cwd
local env = opts.env
local fn_command = assert(opts.fn_command, "Must pass `fn_command`")
Expand Down
2 changes: 1 addition & 1 deletion lua/telescope/finders/async_static_finder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ return function(opts)
input_results = opts.results
end

local entry_maker = opts.entry_maker or make_entry.gen_from_string()
local entry_maker = opts.entry_maker or make_entry.gen_from_string(opts)

local results = {}
for k, v in ipairs(input_results) do
Expand Down