@@ -155,8 +155,10 @@ M.fzf_exec = function(contents, opts)
155155 -- the API accepts both tables and functions which we "stringify"
156156 -- We also send string commands as stringify is also responsible
157157 -- for multiprocess wrapping of shell commands with processing
158- contents = contents and shell .stringify (contents , opts ) or nil
158+ contents = contents and shell .stringify (contents , opts , nil , true ) or nil
159159 assert (contents == nil or type (contents ) == " string" , " contents must be of type string" )
160+ opts = M .convert_reload_actions (contents , opts )
161+ opts = M .convert_exec_silent_actions (opts )
160162 return M .fzf_wrap (contents , opts )
161163end
162164
@@ -172,10 +174,14 @@ M.fzf_live = function(contents, opts)
172174 -- AKA "live": fzf acts as a selector only (fuzzy matching is disabled)
173175 -- each keypress reloads fzf's input usually based on the typed query
174176 -- utilizes fzf's 'change:reload' event or skim's "interactive" mode
175- opts .fn_reload = shell .stringify (contents , opts )
177+ -- convert "reload" actions to fzf's `reload` binds
178+ -- convert "exec_silent" actions to fzf's `execute-silent` binds
179+ opts .fn_reload = shell .stringify (contents , opts , nil , true )
176180 local fzf_field_index = M .fzf_field_index (opts )
177181 local cmd = M .expand_query (opts .fn_reload , fzf_field_index )
178182 contents , opts = M .setup_fzf_interactive_flags (cmd , fzf_field_index , opts )
183+ opts = M .convert_reload_actions (contents , opts )
184+ opts = M .convert_exec_silent_actions (opts )
179185 return M .fzf_wrap (contents , opts )
180186end
181187
@@ -392,10 +398,6 @@ M.fzf = function(contents, opts)
392398
393399 fzf_win :attach_previewer (previewer )
394400 local fzf_bufnr = fzf_win :create ()
395- -- convert "reload" actions to fzf's `reload` binds
396- -- convert "exec_silent" actions to fzf's `execute-silent` binds
397- opts = M .convert_reload_actions (contents , opts )
398- opts = M .convert_exec_silent_actions (opts )
399401 local selected , exit_code = fzf .raw_fzf (contents , M .build_fzf_cli (opts , fzf_win ),
400402 {
401403 fzf_bin = opts .fzf_bin ,
@@ -997,7 +999,7 @@ local patch_shell_action = function(v, opts)
997999 items = (zero_matched and zero_selected ) and {} or items
9981000 end
9991001 v .fn (items , opts )
1000- end , opts , field_index )
1002+ end , opts , field_index , true )
10011003end
10021004
10031005-- converts actions defined with "reload=true" to use fzf's `reload` bind
@@ -1083,7 +1085,8 @@ M.convert_reload_actions = function(reload_cmd, opts)
10831085 -- NOTE: this fixes existence of both load as function and rebind, e.g. git_status with:
10841086 -- setup({ keymap = { fzf = { true, load = function() _G._fzf_load_called = true end } } }
10851087 if type (opts .keymap .fzf .load ) == " function" then
1086- opts .keymap .fzf .load = " execute-silent:" .. shell .stringify_data (opts .keymap .fzf .load , opts )
1088+ opts .keymap .fzf .load = " execute-silent:"
1089+ .. shell .stringify_data (opts .keymap .fzf .load , opts , nil , true )
10871090 end
10881091 if rebind and type (opts .keymap .fzf .load ) == " string" then
10891092 return string.format (" %s+%s" , rebind , opts .keymap .fzf .load )
0 commit comments