From 2153f9ee6178dfd625b1a874eab6399fd0a2d984 Mon Sep 17 00:00:00 2001 From: ray-x Date: Sat, 2 Nov 2024 14:12:26 +1100 Subject: [PATCH] fix for #518 select should accept idx --- lua/go/dap.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lua/go/dap.lua b/lua/go/dap.lua index 64256214e..54623d149 100644 --- a/lua/go/dap.lua +++ b/lua/go/dap.lua @@ -316,8 +316,8 @@ M.run = function(...) return require('dap').toggle_breakpoint() end - local original_select = vim.ui.select - vim.ui.select = _GO_NVIM_CFG.go_select() + -- local original_select = vim.ui.select + -- vim.ui.select = _GO_NVIM_CFG.go_select() -- testopts = {"test", "nearest", "file", "stop", "restart"} log('plugin loaded', mode, optarg) @@ -568,8 +568,12 @@ M.run = function(...) for _, cfg in ipairs(dap.configurations.go) do table.insert(launch_names, cfg.name) end - vim.ui.select(launch_names, { prompt = 'which you would like to debug' }, function(index) - dap.run(dap.configurations.go[index]) + local sel = _GO_NVIM_CFG.go_select() + sel(launch_names, { prompt = 'which you would like to debug' }, function(name, idx) + if idx then + vim.notify(string.format('Debug %d: %s', idx or 1, name)) + dap.run(dap.configurations.go[idx]) + end end) end else -- no args @@ -585,7 +589,7 @@ M.run = function(...) M.pre_mode = dap_cfg.mode or M.pre_mode - vim.ui.select = original_select + -- vim.ui.select = original_select end local unmap = function()