From e95ccbdf4fc8ca373a137940d7b9049b8a256e7b Mon Sep 17 00:00:00 2001 From: srdusr Date: Sun, 7 May 2023 22:19:53 +0200 Subject: Experimenting with new keys for dap.terminate, etc... --- lua/user/keys.lua | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/lua/user/keys.lua b/lua/user/keys.lua index b128a60..7acea19 100644 --- a/lua/user/keys.lua +++ b/lua/user/keys.lua @@ -366,7 +366,7 @@ end) -- Set breakpoints, get variable values, step into/out of functions, etc. map("n", "dc", dap.continue) map("n", "dC", dap.close) -map("n", "dt", dap.terminate) +--map("n", "dt", dap.terminate) map("n", "dd", function() dap.disconnect({ terminateDebuggee = true }) end) map("n", "dn", dap.step_over) map("n", "di", dap.step_into) @@ -377,19 +377,31 @@ map("n", "dB", function() require("notify")("Breakpoints cleared", "warn") end) map("n", "dl", require("dap.ui.widgets").hover) +map("n", "de", function() require("dapui").float_element() end, + { desc = "Open Element" }) +map("n", "dt", function() + require("dapui").close() + require("dap").repl.close() + local session = require("dap").session() + if session then + require("dap").terminate() + end + require("nvim-dap-virtual-text").refresh() + end, { desc = "Terminate Debug" }) + --vim.keymap.set("n", "B", ":lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))") --vim.keymap.set("v", "B", ":lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))") --vim.keymap.set("n", "lp", ":lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message: '))") --vim.keymap.set("n", "dr", ":lua require'dap'.repl.open()") -- Close debugger and clear breakpoints -map("n", "de", function() - dap.clear_breakpoints() - ui.toggle({}) - dap.terminate() - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("=", false, true, true), "n", false) - require("notify")("Debugger session ended", "warn") -end) +--map("n", "de", function() +-- dap.clear_breakpoints() +-- ui.toggle({}) +-- dap.terminate() +-- vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("=", false, true, true), "n", false) +-- require("notify")("Debugger session ended", "warn") +--end) -- Dashboard map("n", "", "Dashboard") -- cgit v1.2.3