summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaƂ Nowotnik <michal@mnowotnik.com>2022-08-13 11:15:59 +0200
committerGitHub <noreply@github.com>2022-08-13 11:15:59 +0200
commit12c08bfde707c07b5bdd13e99243a99220443523 (patch)
tree199995375e7674879a47707bf92b46d5fb8a3234
parente1206cb3e1bd88cdd20ce1fa677534a29ed720ed (diff)
fix: make_entry.gen_from_string is a factory and needs to be called (#2116)
-rw-r--r--lua/telescope/finders.lua6
-rw-r--r--lua/telescope/finders/async_job_finder.lua2
-rw-r--r--lua/telescope/finders/async_oneshot_finder.lua2
-rw-r--r--lua/telescope/finders/async_static_finder.lua2
4 files changed, 6 insertions, 6 deletions
diff --git a/lua/telescope/finders.lua b/lua/telescope/finders.lua
index d9aa810..fe1af96 100644
--- a/lua/telescope/finders.lua
+++ b/lua/telescope/finders.lua
@@ -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,
@@ -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
@@ -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,
diff --git a/lua/telescope/finders/async_job_finder.lua b/lua/telescope/finders/async_job_finder.lua
index f2c4f39..20af604 100644
--- a/lua/telescope/finders/async_job_finder.lua
+++ b/lua/telescope/finders/async_job_finder.lua
@@ -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)
diff --git a/lua/telescope/finders/async_oneshot_finder.lua b/lua/telescope/finders/async_oneshot_finder.lua
index e3bd0ad..bafb134 100644
--- a/lua/telescope/finders/async_oneshot_finder.lua
+++ b/lua/telescope/finders/async_oneshot_finder.lua
@@ -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`")
diff --git a/lua/telescope/finders/async_static_finder.lua b/lua/telescope/finders/async_static_finder.lua
index 7a684f9..140d1c8 100644
--- a/lua/telescope/finders/async_static_finder.lua
+++ b/lua/telescope/finders/async_static_finder.lua
@@ -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