diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 55c5ee1d..5a584bde 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -66,21 +66,22 @@ return { function() require 'dap.protocol' local dap = require 'dap' + -- Search for an existing breakpoint on this line in this buffer ---@return dap.SourceBreakpoint bp that was either found, or an empty placeholder local function find_bp() local buf_bps = require('dap.breakpoints').get(vim.fn.bufnr())[vim.fn.bufnr()] ---@type dap.SourceBreakpoint - local bp = { condition = '', logMessage = '', hitCondition = '', line = vim.fn.line '.' } for _, candidate in ipairs(buf_bps) do if candidate.line and candidate.line == vim.fn.line '.' then - bp = candidate - break + return candidate end end - return bp + + return { condition = '', logMessage = '', hitCondition = '', line = vim.fn.line '.' } end + -- Elicit customization via a UI prompt ---@param bp dap.SourceBreakpoint a breakpoint local function customize_bp(bp)