live_grep_resume: defaulted to multiprocess, better DEBUG message

main
bhagwan 2 years ago
parent d07c5c8522
commit 62d279d74b

@ -84,7 +84,7 @@ M.files_resume = require'fzf-lua.providers.files'.files_resume
M.args = require'fzf-lua.providers.files'.args
M.grep = require'fzf-lua.providers.grep'.grep
M.live_grep = require'fzf-lua.providers.grep'.live_grep_mt
M.live_grep_old = require'fzf-lua.providers.grep'.live_grep
M.live_grep_old = require'fzf-lua.providers.grep'.live_grep_st
M.live_grep_native = require'fzf-lua.providers.grep'.live_grep_native
M.live_grep_resume = require'fzf-lua.providers.grep'.live_grep_resume
M.live_grep_glob = require'fzf-lua.providers.grep'.live_grep_glob_mt

@ -296,7 +296,7 @@ M.spawn_stdio = function(opts, fn_transform, fn_preprocess)
-- end
if opts.debug then
io.stdout:write(opts.cmd.."\n")
io.stdout:write("[DEBUG]: "..opts.cmd.."\n")
end
local stderr, stdout = nil, nil

@ -96,7 +96,8 @@ M.grep = function(opts)
opts.search = nil
end
M.live_grep = function(opts)
-- single threaded version
M.live_grep_st = function(opts)
opts = config.normalize_opts(opts, config.globals.grep)
if not opts then return end
@ -171,6 +172,7 @@ M.live_grep_glob_mt = function(opts)
return M.live_grep_mt(opts)
end
-- multi threaded (multi-process actually) version
M.live_grep_mt = function(opts)
opts = config.normalize_opts(opts, config.globals.grep)
@ -251,18 +253,6 @@ M.live_grep_mt = function(opts)
opts.search = nil
end
M.live_grep_sk = function(opts)
if not opts then opts = {} end
opts.fzf_bin = "sk"
M.live_grep(opts)
end
M.live_grep_fzf = function(opts)
if not opts then opts = {} end
opts.fzf_bin = "fzf"
M.live_grep(opts)
end
M.live_grep_resume = function(opts)
if not opts then opts = {} end
if not opts.search then
@ -271,7 +261,7 @@ M.live_grep_resume = function(opts)
opts.repeat_last_search == nil and true) or
(opts.continue_last_search or opts.repeat_last_search)
end
return M.live_grep(opts)
return M.live_grep_mt(opts)
end
M.live_grep_glob = function(opts)
@ -313,7 +303,7 @@ M.live_grep_glob = function(opts)
:format(opts.rg_opts, glob_arg, search_query, search_path)
return cmd
end
return M.live_grep(opts)
return M.live_grep_st(opts)
end
M.grep_last = function(opts)
@ -359,7 +349,7 @@ M.grep_curbuf = function(opts)
if #opts.filename > 0 and vim.loop.fs_stat(opts.filename) then
opts.filename = path.relative(opts.filename, vim.loop.cwd())
if opts.lgrep then
return M.live_grep(opts)
return M.live_grep_mt(opts)
else
opts.search = ''
return M.grep(opts)

Loading…
Cancel
Save