Skip to content

Commit 56d3e3c

Browse files
committed
feat: add keymap and command to close dap ui
1 parent dbf61a2 commit 56d3e3c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lua/keymap/tool.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,18 @@ local mappings = {
185185
:with_noremap()
186186
:with_silent()
187187
:with_desc("debug: Set breakpoint with condition"),
188-
["n|<leader>dc"] = map_callback(function()
188+
["n|<leader>dr"] = map_callback(function()
189189
require("dap").run_to_cursor()
190190
end)
191191
:with_noremap()
192192
:with_silent()
193193
:with_desc("debug: Run to cursor"),
194+
["n|<leader>dc"] = map_callback(function()
195+
require("dapui").close()
196+
end)
197+
:with_noremap()
198+
:with_silent()
199+
:with_desc("debug: Run to cursor"),
194200
["n|<leader>dl"] = map_callback(function()
195201
require("dap").run_last()
196202
end)

lua/modules/configs/tool/dap/init.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ return function()
4444
)
4545
vim.fn.sign_define("DapLogPoint", { text = icons.dap.LogPoint, texthl = "DapLogPoint", linehl = "", numhl = "" })
4646

47+
vim.api.nvim_create_user_command("DapUIClose", function()
48+
require("dapui").close()
49+
end, {})
50+
4751
---A handler to setup all clients defined under `tool/dap/clients/*.lua`
4852
---@param config table
4953
local function mason_dap_handler(config)

0 commit comments

Comments
 (0)