From fb7385fd8a0bb7a01c400654020595b7300d25d1 Mon Sep 17 00:00:00 2001 From: Ihor Strecheniuk <7116938+igorstr@users.noreply.github.com> Date: Wed, 9 Nov 2022 12:56:20 +0200 Subject: [PATCH] fix: add dap-ui config to lvim.builtin.dap (#3386) --- lua/lvim/core/dap.lua | 83 ++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/lua/lvim/core/dap.lua b/lua/lvim/core/dap.lua index cff50f64..ad0116b9 100644 --- a/lua/lvim/core/dap.lua +++ b/lua/lvim/core/dap.lua @@ -24,6 +24,47 @@ M.config = function() }, ui = { auto_open = true, + config = { + expand_lines = true, + icons = { expanded = "", collapsed = "", circular = "" }, + mappings = { + -- Use a table to apply multiple mappings + expand = { "", "<2-LeftMouse>" }, + open = "o", + remove = "d", + edit = "e", + repl = "r", + toggle = "t", + }, + layouts = { + { + elements = { + { id = "scopes", size = 0.33 }, + { id = "breakpoints", size = 0.17 }, + { id = "stacks", size = 0.25 }, + { id = "watches", size = 0.25 }, + }, + size = 0.33, + position = "right", + }, + { + elements = { + { id = "repl", size = 0.45 }, + { id = "console", size = 0.55 }, + }, + size = 0.27, + position = "bottom", + }, + }, + floating = { + max_height = 0.9, + max_width = 0.5, -- Floats will be treated as percentage of your screen. + border = vim.g.border_chars, -- Border style. Can be 'single', 'double' or 'rounded' + mappings = { + close = { "q", "" }, + }, + }, + }, }, } end @@ -69,47 +110,7 @@ M.setup_ui = function() return end local dapui = require "dapui" - dapui.setup { - expand_lines = true, - icons = { expanded = "", collapsed = "", circular = "" }, - mappings = { - -- Use a table to apply multiple mappings - expand = { "", "<2-LeftMouse>" }, - open = "o", - remove = "d", - edit = "e", - repl = "r", - toggle = "t", - }, - layouts = { - { - elements = { - { id = "scopes", size = 0.33 }, - { id = "breakpoints", size = 0.17 }, - { id = "stacks", size = 0.25 }, - { id = "watches", size = 0.25 }, - }, - size = 0.33, - position = "right", - }, - { - elements = { - { id = "repl", size = 0.45 }, - { id = "console", size = 0.55 }, - }, - size = 0.27, - position = "bottom", - }, - }, - floating = { - max_height = 0.9, - max_width = 0.5, -- Floats will be treated as percentage of your screen. - border = vim.g.border_chars, -- Border style. Can be 'single', 'double' or 'rounded' - mappings = { - close = { "q", "" }, - }, - }, - } + dapui.setup(lvim.builtin.dap.ui.config) if lvim.builtin.dap.ui.auto_open then dap.listeners.after.event_initialized["dapui_config"] = function()