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 -- POPULATE QFLIST ON ERROR {{{1
do do
local orig_traceback = debug.traceback local function full_trace()
debug.traceback = function(...) local lines = {}
local trace = orig_traceback(...)
-- push full trace to quickfix local level = 2
vim.fn.setqflist({}, "a", { while true do
title = "Traceback", local info = debug.getinfo(level, "Sln")
lines = vim.split(trace, "\n"), 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 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 end
-- GENERAL SETTINGS {{{1 -- GENERAL SETTINGS {{{1