mirror of
https://github.com/mfussenegger/nvim-dap
synced 2024-09-16 14:24:03 +02:00
Return dap.ABORT if pick_process is cancelled
This commit is contained in:
parent
083b9f33a7
commit
c65c163daa
2 changed files with 3 additions and 2 deletions
|
@ -28,6 +28,7 @@ local function notify(...)
|
|||
end
|
||||
|
||||
--- Sentinel value; signals an operation should be aborted.
|
||||
---@class dap.Abort
|
||||
M.ABORT = {}
|
||||
|
||||
M.status = function(...)
|
||||
|
|
|
@ -165,7 +165,7 @@ function M.pick_process(opts)
|
|||
local ui = require("dap.ui")
|
||||
local pick = (co and not ismain) and ui.pick_one or ui.pick_one_sync
|
||||
local result = pick(procs, "Select process: ", label_fn)
|
||||
return result and result.pid or nil
|
||||
return result and result.pid or require("dap").ABORT
|
||||
end
|
||||
|
||||
|
||||
|
@ -261,7 +261,7 @@ end
|
|||
--- </pre>
|
||||
---@param opts? {filter?: string|(fun(name: string): boolean), executables?: boolean, path?: string}
|
||||
---
|
||||
---@return thread|string|nil|table
|
||||
---@return thread|string|dap.Abort
|
||||
function M.pick_file(opts)
|
||||
opts = opts or {}
|
||||
local executables = opts.executables == nil and true or opts.executables
|
||||
|
|
Loading…
Reference in a new issue