grep: opts.search overrides continue_last_search (closes #370)

main
bhagwan 2 years ago
parent ab23fb6569
commit 4edaa792ff

@ -439,6 +439,7 @@ require'fzf-lua'.setup {
-- pager = "delta", -- if you have `delta` installed
},
man = {
-- NOTE: remove the `-c` flag when using man-db
cmd = "man -c %s | col -bx",
},
builtin = {

@ -484,6 +484,7 @@ Consult the list below for available settings:
-- pager = "delta", -- if you have `delta` installed
},
man = {
-- NOTE: remove the `-c` flag when using man-db
cmd = "man -c %s | col -bx",
},
builtin = {

@ -115,7 +115,8 @@ M.grep = function(opts)
opts.__MODULE__ = opts.__MODULE__ or M
local no_esc = false
if opts.continue_last_search or opts.repeat_last_search then
if not opts.search and
(opts.continue_last_search or opts.repeat_last_search) then
opts.search, no_esc = get_last_search(opts)
opts.search = opts.search or opts.continue_last_search_default
end
@ -176,7 +177,8 @@ M.live_grep_st = function(opts)
assert(not opts.multiprocess)
local no_esc = false
if opts.continue_last_search or opts.repeat_last_search then
if not opts.search and
(opts.continue_last_search or opts.repeat_last_search) then
opts.search, no_esc = get_last_search(opts)
end
@ -248,7 +250,8 @@ M.live_grep_mt = function(opts)
assert(opts.multiprocess)
local no_esc = false
if opts.continue_last_search or opts.repeat_last_search then
if not opts.search and
(opts.continue_last_search or opts.repeat_last_search) then
opts.search, no_esc = get_last_search(opts)
end

@ -143,7 +143,8 @@ end
M.grep = function(opts)
opts = opts or {}
if opts.continue_last_search or opts.repeat_last_search then
if not opts.search and
(opts.continue_last_search or opts.repeat_last_search) then
opts.search, opts.no_esc = M.get_last_search(opts)
opts.search = opts.search or opts.continue_last_search_default
end

Loading…
Cancel
Save