Went back to single script for luadebug

This commit is contained in:
U-ENGINEERO\joppe.blondel
2025-10-27 14:39:55 +01:00
parent 349cbc8175
commit fa0c8d5a2c
5 changed files with 141 additions and 206 deletions

View File

@ -153,19 +153,30 @@ local function get_selected_target()
end
-- ---------- run target & pipe stdout/stderr into the view ----------
local function ensure_debug_view()
if active_view then
return active_view
end
local node = core.root_view:get_active_node()
local view = JPDebugView()
-- Defer the add until the node is unlocked (next tick).
core.add_thread(function()
-- Wait until the layout is safe to mutate
while node.locked do coroutine.yield(0) end
node:add_view(view)
core.redraw = true
end)
active_view = view
return view
end
local function run_target(target, name)
-- Create/get view to push text to
-- TODO fix this, it throws a node is locked error once in a while
local view = nil
if active_view then
-- If there is already a view use that one
view = active_view
else
-- Otherwhise lets make one
view = JPDebugView()
core.root_view:get_active_node():add_view(view)
active_view = view
end
local view = ensure_debug_view()
-- Check if we have a runner
for runner_name,runner in pairs(core.jpdebug.runners) do