fix(debug): exclude vimrc from callers

This commit is contained in:
Folke Lemaitre 2024-11-05 17:27:42 +01:00
parent b930a9360e
commit 8845a6a912
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -12,7 +12,13 @@ function M.inspect(...)
local caller = debug.getinfo(1, "S")
for level = 2, 10 do
local info = debug.getinfo(level, "S")
if info and info.source ~= caller.source and info.what == "Lua" and info.source ~= "lua" then
if
info
and info.source ~= caller.source
and info.what == "Lua"
and info.source ~= "lua"
and info.source ~= "@" .. vim.env.MYVIMRC
then
caller = info
break
end