Skip to content

Commit a2fe1be

Browse files
phanenibhagwan
authored andcommitted
fix(live_grep_st): slient_fail need to be apply again if we transform the cmd
1 parent 336d6db commit a2fe1be

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

lua/fzf-lua/providers/grep.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,14 @@ M.live_grep = function(opts)
309309
local query = s[1] or ""
310310
opts.no_esc = nil
311311
local cmd0 = get_grep_cmd(opts, query, true)
312-
return core.can_transform(opts) and
313-
("reload:" .. (
314-
not opts.exec_empty_query and #query == 0 and FzfLua.utils.shell_nop() or cmd0))
315-
or cmd0
312+
if not core.can_transform(opts) then return cmd0 end
313+
-- "reload:cmd"
314+
if not opts.exec_empty_query and #query == 0 then
315+
cmd0 = FzfLua.utils.shell_nop()
316+
elseif opts.silent_fail ~= false then
317+
cmd0 = cmd0 .. " || " .. FzfLua.utils.shell_nop()
318+
end
319+
return "reload:" .. cmd0
316320
end, opts)
317321
end
318322

lua/fzf-lua/types.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ _G.FzfLua = require("fzf-lua")
164164
---@field no_resume boolean?
165165
---@field profile string|table?
166166
---@field fn_reload boolean? is "live" picker
167+
---@field silent_fail boolean?
167168
---set_headers
168169
---@field _headers string[]?
169170
---@field headers string[]?

0 commit comments

Comments
 (0)