feat(picker): added live support to git_log, which uses -S (pickaxe) to search. Closes #1544

This commit is contained in:
Folke Lemaitre 2025-10-21 17:49:13 +02:00
parent 924a9304e9
commit c9fa6f7b07
No known key found for this signature in database
GPG key ID: 9B52594D560070AB
2 changed files with 5 additions and 0 deletions

View file

@ -283,6 +283,7 @@ M.git_log = {
format = "git_log", format = "git_log",
preview = "git_show", preview = "git_show",
confirm = "git_checkout", confirm = "git_checkout",
supports_live = true,
sort = { fields = { "score:desc", "idx" } }, sort = { fields = { "score:desc", "idx" } },
} }

View file

@ -139,6 +139,10 @@ function M.log(opts, ctx)
args[#args + 1] = file args[#args + 1] = file
end end
if ctx.filter.search ~= "" then
vim.list_extend(args, { "-S", ctx.filter.search })
end
local Proc = require("snacks.picker.source.proc") local Proc = require("snacks.picker.source.proc")
file = file and svim.fs.normalize(file) or nil file = file and svim.fs.normalize(file) or nil