fix(mail): support LuaJIT unpack

This commit is contained in:
2026-08-09 23:35:40 -04:00
parent 3f38d1d04e
commit a68370f98b

View File

@@ -74,11 +74,14 @@ end
km("<leader>m", "", "Mail")
-- NeoMutt's Neovim Lua runtime may be LuaJIT/Lua 5.1, which exposes only global unpack.
local unpack_args = table.unpack or unpack
-- Safe wrapper: pcall so the keymap degrades gracefully if plugin not yet downloaded.
local function nav(fn, ...)
local args = { ... }
local ok, nav_mod = pcall(require, "nvim-mail.navigate")
if ok then nav_mod[fn](table.unpack(args)) end
if ok then nav_mod[fn](unpack_args(args)) end
end
km("<leader>mt", function() nav("goto_field", "^[Tt]o:", "A") end, "Mail: To:")