Files
neovim/runtime/lua/vim/_core/table.lua
T
Lewis Russell d039f19af5 build: enable more EmmyLua checks
Enable checks for unused code, deprecated calls, return types, and
annotations.

Fix the warnings and replace the deprecated highlight function. Keep
exceptions where old APIs are still needed or the checker gets it wrong.

AI-assisted
2026-09-09 22:31:58 +01:00

27 lines
483 B
Lua

-- Basic shim for LuaJIT's table.new and table.clear.
local has_new, new = pcall(require, 'table.new')
local has_clear, clear = pcall(require, 'table.clear')
local M = {}
if not has_new then
new = function(_narr, _nrec)
return {}
end
end
if not has_clear then
clear = function(tab)
for k in pairs(tab) do
tab[k] = nil
end
end
end
---@cast new fun(narr: integer, nrec: integer): table
---@cast clear fun(tab: table)
M.new = new
M.clear = clear
return M