From 1db3116640c0f6cadff1da42182e6d4c563e48c5 Mon Sep 17 00:00:00 2001 From: Per Malmberg Date: Fri, 10 May 2024 14:51:26 +0200 Subject: [PATCH 1/3] Automatically set detached state as needed. --- lua/kickstart/plugins/debug.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index d4d146594e0..7a13b9afcb4 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -85,6 +85,11 @@ return { dap.listeners.before.event_exited['dapui_config'] = dapui.close -- Install golang specific config - require('dap-go').setup() + require('dap-go').setup { + delve = { + -- On Windows delve must not be run attached or it crashes. + detached = vim.loop.os_uname().sysname ~= 'Windows_NT', + }, + } end, } From 4a64dc14494a797400b36e9142d4db372eedee6b Mon Sep 17 00:00:00 2001 From: Per Malmberg Date: Fri, 10 May 2024 18:18:03 +0200 Subject: [PATCH 2/3] Use vim.fn.has instead. --- lua/kickstart/plugins/debug.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 7a13b9afcb4..6b79eef85e0 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -87,8 +87,9 @@ return { -- Install golang specific config require('dap-go').setup { delve = { - -- On Windows delve must not be run attached or it crashes. - detached = vim.loop.os_uname().sysname ~= 'Windows_NT', + -- On Windows delve must be run attached or it crashes. + -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring + detached = not vim.fn.has 'win32', }, } end, From 0fff88120ae2b2cd350b43a27af7a923e02b7b32 Mon Sep 17 00:00:00 2001 From: Per Malmberg Date: Fri, 10 May 2024 19:15:00 +0200 Subject: [PATCH 3/3] Fix int vs bool. --- lua/kickstart/plugins/debug.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 6b79eef85e0..31dfecf5b38 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -89,7 +89,7 @@ return { delve = { -- On Windows delve must be run attached or it crashes. -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring - detached = not vim.fn.has 'win32', + detached = vim.fn.has 'win32' == 0, }, } end,