aboutsummaryrefslogtreecommitdiff
path: root/lua/plugins/dap.lua
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2025-09-24 00:14:04 +0200
committersrdusr <trevorgray@srdusr.com>2025-09-24 00:14:04 +0200
commit966d12ac730c83da90d60ab24eae539b2ea69441 (patch)
tree702f5f832796b572d0faee31c0eb15507e91f49a /lua/plugins/dap.lua
parent2a8020a2e9b7ef2ee77ddee14892127a4eb95187 (diff)
downloaddotfiles-966d12ac730c83da90d60ab24eae539b2ea69441.tar.gz
dotfiles-966d12ac730c83da90d60ab24eae539b2ea69441.zip
Update/Overhaul
Diffstat (limited to 'lua/plugins/dap.lua')
-rwxr-xr-x[-rw-r--r--]lua/plugins/dap.lua46
1 files changed, 29 insertions, 17 deletions
diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua
index 98ae3fd..7de032c 100644..100755
--- a/lua/plugins/dap.lua
+++ b/lua/plugins/dap.lua
@@ -1,4 +1,10 @@
-local dap = require("dap")
+local M = {}
+
+function M.setup()
+ local ok, dap = pcall(require, "dap")
+ if not ok or not dap then
+ return false
+ end
-- options
dap.defaults.fallback.switchbuf = "uselast"
@@ -155,11 +161,12 @@ local dapui = require("dapui")
--})
-- Load dapui configuration only if it hasn't been loaded before
-if not vim.g.loaded_dapui then
- require("dapui").setup({
- mappings = {
- expand = "<CR>",
- open = "o",
+ local dapui_ok, dapui = pcall(require, "dapui")
+ if dapui_ok and dapui then
+ dapui.setup({
+ mappings = {
+ expand = "<CR>",
+ open = "o",
remove = "D",
edit = "e",
repl = "r",
@@ -240,14 +247,19 @@ end
require("nvim-dap-virtual-text").setup({
enabled = true,
enabled_commands = true,
- highlight_changed_variables = true,
- highlight_new_as_changed = false,
- show_stop_reason = true,
- commented = true,
- only_first_definition = true,
- all_references = false,
- filter_references_pattern = "<module",
- virt_text_pos = "eol",
- all_frames = false,
- virt_text_win_col = nil,
-})
+ highlight_changed_variables = true,
+ highlight_new_as_changed = false,
+ show_stop_reason = true,
+ commented = true,
+ only_first_definition = true,
+ all_references = false,
+ filter_references_pattern = "<module",
+ virt_text_pos = "eol",
+ all_frames = false,
+ virt_text_win_col = nil,
+ })
+
+ return true
+end
+
+return M