Skip to content

Commit 62d618f

Browse files
committed
fix: table.pack may not be defined
1 parent 0a4469b commit 62d618f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lua/tabnine/utils.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
local fn = vim.fn
22
local api = vim.api
3-
3+
local unpack = table.unpack or unpack
4+
local pack = table.pack or vim.F.pack_len
45
local M = {}
56
local last_changedtick = vim.b.changedtick
67

@@ -11,7 +12,7 @@ function M.debounce(func, delay)
1112
local timer_id
1213
return function(...)
1314
if timer_id then fn.timer_stop(timer_id) end
14-
local args = table.pack(...)
15+
local args = pack(...)
1516
timer_id = fn.timer_start(delay, function()
1617
return func(unpack(args, 1, args.n))
1718
end)

0 commit comments

Comments
 (0)