Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions lua/dap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -668,13 +668,27 @@ function M.run(config, opts)
end


--- Run the last debug session again
--- Re-fetches the configuration by name from providers and executes it.
--- This is useful when the environment or dynamic configuration changes
--- between runs, as it ensures the latest config values are used.
function M.run_last()
if last_run then
M.run(last_run.config, last_run.opts)
else
notify('No configuration available to re-run', vim.log.levels.INFO)
if not last_run then
return
end

local bufnr = api.nvim_get_current_buf()
local name = last_run.config.name
for _, config_provider in pairs(providers.configs) do
local configs = config_provider(bufnr)
for _, v in ipairs(configs) do
if v.name == name then
M.run(v, last_run.opts)
return
end
end
end

notify("Could not find configuration with name: " .. name)
end

--- Step over the current line
Expand Down