astro-nvim-v3 - prevent dap ui close when session terminate

This commit is contained in:
huyjaky
2025-01-03 12:19:23 +07:00
parent 2cbb7188c9
commit 1de506b619

View File

@@ -9,7 +9,7 @@ return {
open = "o", open = "o",
remove = "d", remove = "d",
repl = "r", repl = "r",
toggle = "t" toggle = "t",
}, },
layouts = { layouts = {
@@ -47,4 +47,22 @@ return {
}, },
}, },
}, },
config = function(_, opts)
local dap = require "dap"
local dapui = require "dapui"
-- Initialize dap-ui
dapui.setup(opts)
-- Prevent UI from closing when debugging session ends
dap.listeners.after.event_terminated["dapui"] = function()
-- Do nothing, keeping the UI open
end
dap.listeners.after.event_exited["dapui"] = function()
-- Do nothing, keeping the UI open
end
-- Optionally, open dap-ui when session starts
dap.listeners.after.event_initialized["dapui"] = function() dapui.open() end
end,
} }