Skip to content

Commit 96ac1b5

Browse files
committed
fix(global): disable multiprocess for function contents
Closes #2346
1 parent f8cf874 commit 96ac1b5

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lua/fzf-lua/shell.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ M.stringify_mt = function(contents, opts)
259259
-- command does not require any processing
260260
return contents
261261
-- don't use mt for non-string contents unless explictly set truthy multiprocess
262-
elseif not opts.multiprocess and type(opts.cmd) ~= "string" then
262+
elseif opts.multiprocess ~= true and type(contents) ~= "string" then
263263
return nil
264264
else
265265
opts.contents = contents
@@ -518,7 +518,7 @@ M.wrap_spawn_stdio = function(opts)
518518
local is_win = utils.__IS_WINDOWS
519519
local nvim_bin = os.getenv("FZF_LUA_NVIM_BIN") or vim.v.progpath
520520
-- TODO: should we check "cmd"?
521-
for _, k in ipairs({ "fn_transform", "fn_preprocess", "fn_postprocess" }) do
521+
for _, k in ipairs({ "contents", "fn_transform", "fn_preprocess", "fn_postprocess" }) do
522522
if type(opts[k]) == "function" then
523523
-- opts[k] = M.check_upvalue(opts[k], "opts." .. k)
524524
M.check_upvalue(opts[k], "opts." .. k)

tests/api_spec.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ T["api"]["fzf_exec"]["table"] = function(multiprocess)
1919
end
2020
end
2121
helpers.FzfLua.fzf_exec(child, contents,
22-
{ __expect_lines = true, __postprocess_wait = true, multiprocess = multiprocess })
22+
{ __expect_lines = true, __postprocess_wait = true, multiprocess = multiprocess == true })
2323
end
2424

2525
T["api"]["fzf_exec"]["function"] = new_set({ parametrize = { { "sync" }, { "async" } } }, {
@@ -109,7 +109,7 @@ T["api"]["fzf_live"]["table"] = function(multiprocess)
109109
__expect_lines = true,
110110
__postprocess_wait = true,
111111
query = 100,
112-
multiprocess = multiprocess,
112+
multiprocess = multiprocess == true,
113113
})
114114
end
115115

@@ -135,7 +135,7 @@ T["api"]["fzf_live"]["function"] = new_set({ parametrize = { { "sync" }, { "asyn
135135
__expect_lines = true,
136136
__postprocess_wait = true,
137137
query = 100,
138-
multiprocess = multiprocess,
138+
multiprocess = multiprocess == true,
139139
})
140140
else
141141
helpers.FzfLua.fzf_live(child, function(args)

0 commit comments

Comments
 (0)