fixing dap-ui dependencies/timing, added <leader>cdu for dap-ui toggle
This commit is contained in:
1 parent
66942a1daa
commit
336490e550
2 files changed
+15
-3
No files matched your search
@@ -55,4 +55,7 @@ if status_ok then
|
||||
vim.keymap.set("n", "<leader>cdh", function()
|
||||
require("dap.ui.widgets").hover()
|
||||
end, { desc = "DAP: Hover Variable Value" })
|
||||
vim.keymap.set("n", "<leader>cdu", function()
|
||||
require("dapui").toggle()
|
||||
end, { desc = "Debug: Toggle UI" })
|
||||
end
|
||||
@@ -131,9 +131,18 @@ return {
|
||||
})
|
||||
|
||||
-- Automatically open/close DAP UI panels
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function() dapui.open() end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function() dapui.close() end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function() dapui.close() end
|
||||
-- Defer the open so nvim-dap-ui's async (nio) element buffers are ready.
|
||||
-- Opening synchronously from inside the DAP event listener races buffer
|
||||
-- creation and throws "layout.lua: Invalid buffer id: -1".
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
vim.schedule(function() dapui.open() end)
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
vim.schedule(function() dapui.close() end)
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
vim.schedule(function() dapui.close() end)
|
||||
end
|
||||
|
||||
-- Step 2 & 3 configurations will go here...
|
||||
-- 1. Detect operating system
|
||||
|
||||
Reference in new issue
Block a user