mirror of
https://github.com/zoriya/flake.git
synced 2025-12-06 06:36:19 +00:00
Fix snack picker breaking change
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
local function git_show(ref)
|
local function git_show(ref)
|
||||||
local git_root = Snacks.git.get_root()
|
local git_root = Snacks.git.get_root()
|
||||||
local function finder(opts, ctx)
|
---@type snacks.picker.finder
|
||||||
return require("snacks.picker.source.proc").proc({
|
local function finder(_opts, ctx)
|
||||||
opts,
|
return require("snacks.picker.source.proc").proc(
|
||||||
{
|
ctx:opts({
|
||||||
cmd = "git",
|
cmd = "git",
|
||||||
args = { "show", "--name-status", "--pretty=tformat:", ref },
|
args = { "show", "--name-status", "--pretty=tformat:", ref },
|
||||||
cwd = Snacks.git.get_root(),
|
cwd = Snacks.git.get_root(),
|
||||||
@@ -12,8 +12,9 @@ local function git_show(ref)
|
|||||||
item.file = string.sub(item.text, 3)
|
item.file = string.sub(item.text, 3)
|
||||||
item.commit = ref
|
item.commit = ref
|
||||||
end,
|
end,
|
||||||
},
|
}),
|
||||||
}, ctx)
|
ctx
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
Snacks.picker.pick({
|
Snacks.picker.pick({
|
||||||
@@ -263,19 +264,19 @@ return {
|
|||||||
end, { desc = "Grep" })
|
end, { desc = "Grep" })
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>gl", function()
|
vim.keymap.set("n", "<leader>gl", function()
|
||||||
Snacks.picker.git_log({cwd = Snacks.git.get_root() })
|
Snacks.picker.git_log({ cwd = Snacks.git.get_root() })
|
||||||
end, { desc = "Git log" })
|
end, { desc = "Git log" })
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>gh", function()
|
vim.keymap.set("n", "<leader>gh", function()
|
||||||
Snacks.picker.git_log_file({cwd = Snacks.git.get_root() })
|
Snacks.picker.git_log_file({ cwd = Snacks.git.get_root() })
|
||||||
end, { desc = "Git logs buffer" })
|
end, { desc = "Git logs buffer" })
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>gB", function()
|
vim.keymap.set("n", "<leader>gB", function()
|
||||||
Snacks.picker.git_branches({cwd = Snacks.git.get_root() })
|
Snacks.picker.git_branches({ cwd = Snacks.git.get_root() })
|
||||||
end, { desc = "Git branches" })
|
end, { desc = "Git branches" })
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>gs", function()
|
vim.keymap.set("n", "<leader>gs", function()
|
||||||
Snacks.picker.git_status({cwd = Snacks.git.get_root() })
|
Snacks.picker.git_status({ cwd = Snacks.git.get_root() })
|
||||||
end, { desc = "Git status" })
|
end, { desc = "Git status" })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user