File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9898
9999M .act = function (selected , opts )
100100 if not selected then return end
101- if opts .__alt_opts then
102- opts .__alt_opts .last_query = opts .last_query
103- opts .__alt_opts .__INFO = opts .__INFO
104- end
105101 local actions = opts .actions
106102 local keybind , entries = M .normalize_selected (selected , opts )
107103 -- fzf >= 0.53 and `--exit-0`
@@ -116,10 +112,10 @@ M.act = function(selected, opts)
116112 -- (1) map containing action properties (reload, noclose, etc)
117113 -- (2) array of actions to be executed serially
118114 if action .fn then
119- action .fn (entries , opts . __alt_opts or opts )
115+ action .fn (entries , opts )
120116 else
121117 for _ , f in ipairs (action ) do
122- f (entries , opts . __alt_opts or opts )
118+ f (entries , opts )
123119 end
124120 end
125121 elseif type (action ) == " function" then
Original file line number Diff line number Diff line change 416416--- @param force_uri boolean ?
417417--- @return fzf-lua.path.Entry
418418function M .entry_to_file (entry , opts , force_uri )
419- opts = opts or {}
419+ -- NOTE: see note in meta.lua:global regarding alt options
420+ opts = opts and opts .__alt_opts or opts or {}
420421 if opts ._fmt then
421422 if type (opts ._fmt ._from ) == " function" then
422423 entry = opts ._fmt ._from (entry , opts )
Original file line number Diff line number Diff line change @@ -67,16 +67,11 @@ return {
6767 act .exec_silent = true
6868 act .desc = act .desc or fzf .config .get_action_helpstr (fn )
6969 act .fn = function (...)
70- local sel = select (1 , ... )
71- local o = select (2 , ... )
72- if o .__alt_opts then
73- o .__alt_opts .last_query = o .last_query
74- o .__alt_opts .__INFO = o .__INFO
75- end
7670 fzf .hide ()
77- fn (sel , o . __alt_opts or o )
71+ fn (... )
7872 -- As the process never terminates fzf history is never written
7973 -- manually append to the fzf history file if needed
74+ local o = select (2 , ... )
8075 if histfile and type (o .last_query ) == " string" and # o .last_query > 0 then
8176 local fd = uv .fs_open (histfile , " a" , - 1 )
8277 if fd then
Original file line number Diff line number Diff line change @@ -229,10 +229,11 @@ M.global = function(opts)
229229 end , opts , " {q}" )
230230 end
231231
232- table.insert (opts ._fzf_cli_args , " --bind="
232+ -- Insert at the start of the args table so `line_query` callback is first
233+ table.insert (opts ._fzf_cli_args , 1 , " --bind="
233234 .. libuv .shellescape (" start:+transform:" .. transform_picker (true )))
234235
235- table.insert (opts ._fzf_cli_args , " --bind="
236+ table.insert (opts ._fzf_cli_args , 2 , " --bind="
236237 .. libuv .shellescape (" change:+transform:" .. transform_picker (false )))
237238
238239 if opts .header ~= false then
You can’t perform that action at this time.
0 commit comments