From 34faa25d3a097b0f4da987f934675c1ef6ff1b99 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Fri, 14 Nov 2025 23:13:31 +0100 Subject: [PATCH] Fix snack picker breaking change --- nvim/lua/plugins/snacks.lua | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/nvim/lua/plugins/snacks.lua b/nvim/lua/plugins/snacks.lua index ba074e4..d1bdfaa 100644 --- a/nvim/lua/plugins/snacks.lua +++ b/nvim/lua/plugins/snacks.lua @@ -1,9 +1,9 @@ local function git_show(ref) local git_root = Snacks.git.get_root() - local function finder(opts, ctx) - return require("snacks.picker.source.proc").proc({ - opts, - { + ---@type snacks.picker.finder + local function finder(_opts, ctx) + return require("snacks.picker.source.proc").proc( + ctx:opts({ cmd = "git", args = { "show", "--name-status", "--pretty=tformat:", ref }, cwd = Snacks.git.get_root(), @@ -12,8 +12,9 @@ local function git_show(ref) item.file = string.sub(item.text, 3) item.commit = ref end, - }, - }, ctx) + }), + ctx + ) end Snacks.picker.pick({ @@ -263,19 +264,19 @@ return { end, { desc = "Grep" }) vim.keymap.set("n", "gl", function() - Snacks.picker.git_log({cwd = Snacks.git.get_root() }) + Snacks.picker.git_log({ cwd = Snacks.git.get_root() }) end, { desc = "Git log" }) vim.keymap.set("n", "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" }) vim.keymap.set("n", "gB", function() - Snacks.picker.git_branches({cwd = Snacks.git.get_root() }) + Snacks.picker.git_branches({ cwd = Snacks.git.get_root() }) end, { desc = "Git branches" }) vim.keymap.set("n", "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, },