diff --git a/lua/system/repr.lua b/lua/system/repr.lua index f0bedb5eef..06483a8df6 100644 --- a/lua/system/repr.lua +++ b/lua/system/repr.lua @@ -47,15 +47,19 @@ local tostring = tostring local rep = string.rep local flr = math.floor local match = string.match +local substr = string.sub local gsub = string.gsub local fmt = string.format local _rawget = rawget local type = type local getmetatable = getmetatable +local debugGetInfo = debug.getinfo local TableSort = table.sort local TableEmpty = table.empty +local DiskToLocal = DiskToLocal + ---@param t table ---@return function ---@return table @@ -187,8 +191,8 @@ function Inspector:getId(v) id = (ids[tv] or 0) + 1 ids[tv] = id if tv == "function" then - local info = debug.getinfo(v, "S") - id = fmt("%s %s(%d)", id, DiskToLocal(string.sub(info.source, 2)--[[@as FileName]]), info.linedefined) + local info = debugGetInfo(v, "S") + id = fmt("%s %s(%d)", id, DiskToLocal(substr(info.source, 2)--[[@as FileName]]), info.linedefined) end ids[v] = id end