diff --git a/lua/dap/repl.lua b/lua/dap/repl.lua index 0289d782..d0289f20 100644 --- a/lua/dap/repl.lua +++ b/lua/dap/repl.lua @@ -27,7 +27,7 @@ local function new_buf() if ok then api.nvim_buf_set_option(buf, 'path', path) end - api.nvim_buf_set_keymap(buf, 'n', '', "lua require('dap.ui').trigger_actions({ filter = 'Expand' })", {}) + api.nvim_buf_set_keymap(buf, 'n', '', "lua require('dap.ui').trigger_actions({ mode = 'first' })", {}) api.nvim_buf_set_keymap(buf, 'i', '', "lua require('dap.repl').on_up()", {}) api.nvim_buf_set_keymap(buf, 'i', '', "lua require('dap.repl').on_down()", {}) vim.fn.prompt_setprompt(buf, 'dap> ') diff --git a/lua/dap/ui.lua b/lua/dap/ui.lua index 0268b9a4..b09d2273 100644 --- a/lua/dap/ui.lua +++ b/lua/dap/ui.lua @@ -353,6 +353,11 @@ function M.trigger_actions(opts) utils.notify('No action possible on: ' .. api.nvim_buf_get_lines(buf, lnum, lnum + 1, true)[1], vim.log.levels.INFO) return end + if opts.mode == 'first' then + local action = actions[1] + action.fn(layer, info.item, lnum, info.context) + return + end M.pick_if_many( actions, 'Actions> ', diff --git a/lua/dap/ui/widgets.lua b/lua/dap/ui/widgets.lua index e1955844..667a855b 100644 --- a/lua/dap/ui/widgets.lua +++ b/lua/dap/ui/widgets.lua @@ -10,7 +10,7 @@ local function new_buf() api.nvim_buf_set_option(buf, 'buftype', 'nofile') api.nvim_buf_set_option(buf, 'modifiable', false) api.nvim_buf_set_keymap( - buf, "n", "", "lua require('dap.ui').trigger_actions({ filter = 'Expand' })", {}) + buf, "n", "", "lua require('dap.ui').trigger_actions({ mode = 'first' })", {}) api.nvim_buf_set_keymap( buf, "n", "a", "lua require('dap.ui').trigger_actions()", {}) api.nvim_buf_set_keymap(