diff --git a/lua/custom/plugins/configs/dapui.lua b/lua/custom/plugins/configs/dapui.lua index 6ce093f..729f5e1 100644 --- a/lua/custom/plugins/configs/dapui.lua +++ b/lua/custom/plugins/configs/dapui.lua @@ -14,7 +14,7 @@ local opts = { }, -- Expand lines larger than the window -- Requires >= 0.7 - expand_lines = vim.fn.has("nvim-0.7") == 1, + expand_lines = true, -- Layouts define sections of the screen to place windows. -- The position can be "left", "right", "top" or "bottom". -- The size specifies the height/width depending on position. It can be an Int @@ -26,9 +26,9 @@ local opts = { { elements = { -- Elements can be strings or table with id and size keys. - { id = "scopes", size = 0.25 }, - "breakpoints", - "stacks", + { id = "scopes", size = 0.5 }, + { id = "breakpoints", size = 0.25 }, + { id = "stacks", size = 0.25 }, -- "watches", }, size = 40, -- 40 columns @@ -36,17 +36,19 @@ local opts = { }, { elements = { - "repl", - "watches" + { id = "repl", size = 0.7 }, + { id = "watches", size = 0.5 }, -- "console", }, - size = 0.25, -- 25% of total lines + size = 10, -- 25% of total lines position = "bottom", }, }, + -- where to display controls controls = { -- Requires Neovim nightly (or 0.8 when released) enabled = true, + -- Display controls in this element element = "repl", icons = { @@ -61,14 +63,11 @@ local opts = { }, }, floating = { - max_height = nil, -- These can be integers or a float between 0 and 1. - max_width = nil, -- Floats will be treated as percentage of your screen. border = "single", -- Border style. Can be "single", "double" or "rounded" mappings = { close = { "q", "" }, }, }, - windows = { indent = 1 }, render = { max_type_length = nil, -- Can be integer or nil. max_value_lines = 100, -- Can be integer or nil. @@ -80,5 +79,7 @@ M.setup = function() dapui.setup(opts) end +M.opts = opts + return M diff --git a/lua/custom/plugins/configs/gonvim.lua b/lua/custom/plugins/configs/gonvim.lua index 544404a..1954e51 100644 --- a/lua/custom/plugins/configs/gonvim.lua +++ b/lua/custom/plugins/configs/gonvim.lua @@ -3,6 +3,8 @@ if not ok then vim.notify("missing module null-ls", vim.log.levels.WARN) end +local dapui_cfg = require("custom.plugins.configs.dapui").opts + local M = {} local config = { @@ -16,7 +18,7 @@ local config = { lsp_codelens = false, -- use navigator textobjects = true, dap_debug_keymap = false, - -- dap_debug_gui = false, + dap_debug_gui = dapui_cfg, -- dap_debug_vt = false, log_path = vim.fn.stdpath('cache') .. '/gonvim.log', lsp_inlay_hints = { diff --git a/lua/spike/dap/dapmode.lua b/lua/spike/dap/dapmode.lua index 0c1c235..1e6c059 100644 --- a/lua/spike/dap/dapmode.lua +++ b/lua/spike/dap/dapmode.lua @@ -47,7 +47,7 @@ local config = { end, desc = '[dap] step out' }, - r = { + R = { rhs = function() require('dap').run_last() end, diff --git a/lua/spike/dap/init.lua b/lua/spike/dap/init.lua index 77d4aee..c475355 100644 --- a/lua/spike/dap/init.lua +++ b/lua/spike/dap/init.lua @@ -47,6 +47,11 @@ local function register_listeners() dapmode.stop() dapui.close() end + dap.listeners.after['event_exited']['blob42-dap'] = function(_, _) + -- print("dap session ended") + dapmode.stop() + dapui.close() + end end function M.go_debug()