fix(mail): support LuaJIT unpack
This commit is contained in:
@@ -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:")
|
||||
|
||||
Reference in New Issue
Block a user