Skip to content

Commit

Permalink
fix: table.pack may not be defined
Browse files Browse the repository at this point in the history
  • Loading branch information
aarondill committed Feb 6, 2024
1 parent 1c329f6 commit 1b523d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/tabnine/utils.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local fn = vim.fn
local api = vim.api
local unpack = table.unpack or unpack

local pack = table.pack or vim.F.pack_len
local M = {}

---@param func fun(...: unknown): any the callback
Expand All @@ -11,7 +11,7 @@ function M.debounce(func, delay)
local timer_id
return function(...)
if timer_id then fn.timer_stop(timer_id) end
local args = table.pack(...)
local args = pack(...)
timer_id = fn.timer_start(delay, function()
return func(unpack(args, 1, args.n))
end)
Expand Down

0 comments on commit 1b523d3

Please sign in to comment.