From ead3cbec95868f0b696bd863e858376e9fa82665 Mon Sep 17 00:00:00 2001 From: Per Malmberg Date: Sun, 12 May 2024 11:39:53 +0200 Subject: [PATCH 1/3] Automatically set attached mode for devle. --- README.md | 2 +- lua/dap-go.lua | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fcb07b8..c885be5 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ lua require('dap-go').setup { -- whether the dlv process to be created detached or not. there is -- an issue on Windows where this needs to be set to false -- otherwise the dlv server creation will fail. - detached = true + detached = vim.fn.has 'win32' == 0 -- the current working directory to run dlv from, if other than -- the current working directory. cwd = nil, diff --git a/lua/dap-go.lua b/lua/dap-go.lua index a365043..f4fb37d 100644 --- a/lua/dap-go.lua +++ b/lua/dap-go.lua @@ -13,7 +13,9 @@ local default_config = { port = "${port}", args = {}, build_flags = "", - detached = true, + -- Automativally handle the issue on Windows where delve needs + -- to be run in attched mode or it will fail (actuall crash). + detached = vim.fn.has("win32") == 0, }, } From a8dadc64af47fca7ad6a5181b06cd06792bfb216 Mon Sep 17 00:00:00 2001 From: Per Malmberg Date: Sun, 12 May 2024 11:56:15 +0200 Subject: [PATCH 2/3] Fix readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c885be5..bdf05a0 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ lua require('dap-go').setup { -- whether the dlv process to be created detached or not. there is -- an issue on Windows where this needs to be set to false -- otherwise the dlv server creation will fail. - detached = vim.fn.has 'win32' == 0 + detached = vim.fn.has("win32") == 0, -- the current working directory to run dlv from, if other than -- the current working directory. cwd = nil, From 07b9c1934fad38106b39b451538e249e7c6e2a51 Mon Sep 17 00:00:00 2001 From: Per Malmberg Date: Sun, 12 May 2024 11:58:52 +0200 Subject: [PATCH 3/3] Fix typo --- lua/dap-go.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/dap-go.lua b/lua/dap-go.lua index f4fb37d..eb5eaf6 100644 --- a/lua/dap-go.lua +++ b/lua/dap-go.lua @@ -14,7 +14,7 @@ local default_config = { args = {}, build_flags = "", -- Automativally handle the issue on Windows where delve needs - -- to be run in attched mode or it will fail (actuall crash). + -- to be run in attched mode or it will fail (actually crashes). detached = vim.fn.has("win32") == 0, }, }