fix(picker.actions): dont overwrite existing actions

This commit is contained in:
Folke Lemaitre 2025-01-13 23:25:48 +01:00
parent 70e3b6681e
commit 15cd5901d9
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -78,11 +78,12 @@ function M.resolve(action, picker, name)
desc = name or nil,
} or action
---@cast action snacks.picker.Action
local fn = action.action
action.action = function()
return fn(picker, picker:current())
end
return action
return {
action = function(_, item)
return action.action(picker, item)
end,
desc = action.desc,
}
end
return M