diff --git a/lua/fzf-lua/defaults.lua b/lua/fzf-lua/defaults.lua index 1f977539d..83be43b21 100644 --- a/lua/fzf-lua/defaults.lua +++ b/lua/fzf-lua/defaults.lua @@ -1071,8 +1071,10 @@ M.defaults.command_history = { } M.defaults.search_history = { - fzf_opts = { ["--tiebreak"] = "index", ["--no-multi"] = true }, - actions = { + fzf_opts = { ["--tiebreak"] = "index", ["--no-multi"] = true }, + _treesitter = function(line) return "", nil, line, "regex" end, + fzf_colors = { ["hl"] = "-1:reverse", ["hl+"] = "-1:reverse" }, + actions = { ["enter"] = actions.search_cr, ["ctrl-e"] = actions.search, }, diff --git a/lua/fzf-lua/providers/nvim.lua b/lua/fzf-lua/providers/nvim.lua index 107e2be35..cdac3b717 100644 --- a/lua/fzf-lua/providers/nvim.lua +++ b/lua/fzf-lua/providers/nvim.lua @@ -106,6 +106,7 @@ M.commands = function(opts) core.fzf_exec(entries, opts) end +---@param str ":"|"/" local history = function(opts, str) local histnr = vim.fn.histnr(str) local dr = opts.reverse_list and 1 or -1 @@ -119,7 +120,7 @@ local history = function(opts, str) for j = 0, delta - dr, dr do local index = i + j if dr > 0 and index <= to or dr < 0 and index >= to then - cb(vim.fn.histget(":", index), function() + cb(vim.fn.histget(str, index), function() count = count - 1 if count == 0 then coroutine.resume(co) end end)