closes #102
This commit is contained in:
parent
2617aa1587
commit
ce30520aef
@ -263,6 +263,10 @@ M.fzf_files_interactive = function(opts)
|
||||
opts = opts or config.normalize_opts(opts, config.globals.files)
|
||||
if not opts then return end
|
||||
|
||||
-- cannot be nil
|
||||
local query = opts._live_query or ''
|
||||
local placeholder = utils._if(opts._is_skim, '"{}"', '{q}')
|
||||
|
||||
local uv = vim.loop
|
||||
local raw_async_act = require("fzf.actions").raw_async_action(function(pipe, args)
|
||||
local shell_cmd = opts._cb_live_cmd(args[1])
|
||||
@ -310,18 +314,10 @@ M.fzf_files_interactive = function(opts)
|
||||
|
||||
output_pipe:read_start(read_cb)
|
||||
error_pipe:read_start(read_cb)
|
||||
end)
|
||||
end, placeholder)
|
||||
|
||||
local act_cmd = raw_async_act
|
||||
|
||||
-- cannot be nil
|
||||
local query = opts._live_query or ''
|
||||
local placeholder = utils._if(opts._is_skim, '"{}"', '{q}')
|
||||
|
||||
-- HACK: nvim-fzf action rg assumes preview placeholder '{+}'
|
||||
-- replace it with the correct query placeholder
|
||||
act_cmd = act_cmd:gsub("{%+}", placeholder)
|
||||
|
||||
if opts._is_skim then
|
||||
-- do not run an empty string query unless the user requested
|
||||
if not opts.exec_empty_query then
|
||||
|
@ -326,7 +326,7 @@ function Previewer:action(_)
|
||||
local entry = path.entry_to_file(items[1], self.opts.cwd)
|
||||
self:display_entry(entry)
|
||||
return ""
|
||||
end)
|
||||
end, "{}")
|
||||
return act
|
||||
end
|
||||
|
||||
|
@ -51,7 +51,7 @@ end
|
||||
|
||||
function Previewer.cmd:action(o)
|
||||
o = o or {}
|
||||
local filespec = "{+}"
|
||||
local filespec = "{}"
|
||||
if self.opts._line_placeholder then
|
||||
filespec = "{1}"
|
||||
end
|
||||
@ -122,7 +122,7 @@ function Previewer.cmd_async:cmdline(o)
|
||||
-- uncomment to see the command in the preview window
|
||||
-- cmd = vim.fn.shellescape(cmd)
|
||||
return cmd
|
||||
end)
|
||||
end, "{}")
|
||||
return act
|
||||
end
|
||||
|
||||
@ -151,7 +151,7 @@ function Previewer.bat_async:cmdline(o)
|
||||
-- uncomment to see the command in the preview window
|
||||
-- cmd = vim.fn.shellescape(cmd)
|
||||
return cmd
|
||||
end)
|
||||
end, "{}")
|
||||
return act
|
||||
end
|
||||
|
||||
@ -182,7 +182,7 @@ function Previewer.git_diff:cmdline(o)
|
||||
-- uncomment to see the command in the preview window
|
||||
-- cmd = vim.fn.shellescape(cmd)
|
||||
return cmd
|
||||
end)
|
||||
end, "{}")
|
||||
return act
|
||||
end
|
||||
|
||||
|
@ -86,6 +86,7 @@ end
|
||||
M.branches = function(opts)
|
||||
opts = config.normalize_opts(opts, config.globals.git.branches)
|
||||
if not opts then return end
|
||||
opts.nomulti = true
|
||||
opts._preview = path.git_cwd(opts.preview, opts.cwd)
|
||||
opts.preview = fzf_helpers.choices_to_shell_cmd_previewer(function(items)
|
||||
local branch = items[1]:gsub("%*", "") -- remove the * from current branch
|
||||
|
Loading…
Reference in New Issue
Block a user