From f39d1144e707d59857dfa5d78162748d1e8cef4a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 20 Oct 2025 17:46:08 +0200 Subject: [PATCH] fix(picker.man): make tab/split/vsplit work. Closes #2171 --- lua/snacks/picker/config/sources.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/snacks/picker/config/sources.lua b/lua/snacks/picker/config/sources.lua index b22b8815..01349858 100644 --- a/lua/snacks/picker/config/sources.lua +++ b/lua/snacks/picker/config/sources.lua @@ -623,11 +623,18 @@ M.man = { finder = "system_man", format = "man", preview = "man", - confirm = function(picker, item) + confirm = function(picker, item, action) + ---@cast action snacks.picker.jump.Action picker:close() if item then vim.schedule(function() - vim.cmd("Man " .. item.ref) + local cmd = "Man " .. item.ref ---@type string + if action.cmd == "vsplit" then + cmd = "vert " .. cmd + elseif action.cmd == "tab" then + cmd = "tab " .. cmd + end + vim.cmd(cmd) end) end end,