file locations only now...

This commit is contained in:
Ivar Fatland
2026-04-18 13:06:36 +02:00
parent 9b2f6913f5
commit a69580306d
+34 -9
View File
@@ -8,18 +8,43 @@ vim.g.python3_host_prog = get_python_venv_path()
-- POPULATE QFLIST ON ERROR {{{1
do
local orig_traceback = debug.traceback
debug.traceback = function(...)
local trace = orig_traceback(...)
local function full_trace()
local lines = {}
-- push full trace to quickfix
vim.fn.setqflist({}, "a", {
title = "Traceback",
lines = vim.split(trace, "\n"),
})
local level = 2
while true do
local info = debug.getinfo(level, "Sln")
if not info then break end
return trace
local src = info.source or "?"
local file = src:gsub("^@", "") -- remove @ prefix
local line = string.format(
"%s:%d: in %s",
file,
info.currentline or 0,
info.name or "?"
)
table.insert(lines, line)
level = level + 1
end
return table.concat(lines, "\n")
end
local orig = debug.traceback
debug.traceback = function(...)
local trace = full_trace()
vim.fn.setqflist({}, "a", {
title = "Traceback",
lines = vim.split(trace, "\n"),
})
return trace
end
end
-- GENERAL SETTINGS {{{1