mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
fix(lua): preserve argument lists which are not lists
This commit is contained in:
@@ -27,5 +27,14 @@ function F.nil_wrap(fn)
|
||||
end
|
||||
end
|
||||
|
||||
--- like {...} except preserve the lenght explicitly
|
||||
function F.pack_len(...)
|
||||
return {n=select('#', ...), ...}
|
||||
end
|
||||
|
||||
--- like unpack() but use the length set by F.pack_len if present
|
||||
function F.unpack_len(t)
|
||||
return unpack(t, 1, t.n)
|
||||
end
|
||||
|
||||
return F
|
||||
|
||||
Reference in New Issue
Block a user