Skip to content

Commit 2832277

Browse files
committed
fix(skim): more v1 live_grep adjustments
1 parent 21b9acf commit 2832277

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

lua/fzf-lua/core.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,15 +1117,19 @@ M.setup_fzf_live_flags = function(command, bind_start, opts)
11171117
opts.__prompt = opts.prompt
11181118
opts.prompt = nil
11191119
end
1120-
-- since we surrounded the skim placeholder with quotes
1121-
-- we need to escape them in the initial query
1122-
opts.fzf_opts["--cmd-query"] = utils.sk_escape(opts.query)
1120+
opts.fzf_opts["--cmd-query"] = utils.has(opts, "sk", { 1, 5, 3 }) and opts.query
1121+
-- NOTE: skim <v1, since we surrounded the skim placeholder
1122+
-- with quotes we need to escape them in the initial query
1123+
or utils.sk_escape(opts.query)
11231124
-- '--query' was set by 'resume()', skim has the option to switch back and
11241125
-- forth between interactive command and fuzzy matching (using 'ctrl-q')
11251126
-- setting both '--query' and '--cmd-query' will use <query> to fuzzy match
11261127
-- on top of our result set, double filtering our results (undesirable)
11271128
opts.fzf_opts["--query"] = nil
11281129
opts.query = nil
1130+
-- flag swap "histoey" <-> "cmd-history"
1131+
opts.fzf_opts["--cmd-history"] = opts.fzf_opts["--history"]
1132+
opts.fzf_opts["--history"] = nil
11291133
-- setup as interactive
11301134
table.insert(opts._fzf_cli_args, string.format("--interactive --cmd %s",
11311135
libuv.shellescape(reload_command)))

0 commit comments

Comments
 (0)