fix(picker.man): make tab/split/vsplit work. Closes #2171

This commit is contained in:
Folke Lemaitre 2025-10-20 17:46:08 +02:00
parent c01215c74f
commit f39d1144e7
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -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,