File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -900,18 +900,25 @@ M.complete = function(selected, opts)
900
900
end
901
901
902
902
M .dap_bp_del = function (selected , opts )
903
+ local bufnrs = {}
903
904
local dap_bps = require (" dap.breakpoints" )
904
905
for _ , e in ipairs (selected ) do
905
906
local entry = path .entry_to_file (e , opts )
906
907
if entry .bufnr > 0 and entry .line then
907
908
dap_bps .remove (entry .bufnr , entry .line )
909
+ table.insert (bufnrs , tonumber (entry .bufnr ))
908
910
end
909
911
end
910
912
-- removing the BP will update the UI, if we're in session
911
913
-- we also need to broadcast the BP delete to the DAP server
912
914
local session = require (" dap" ).session ()
913
915
if session then
914
916
local bps = dap_bps .get ()
917
+ for _ , b in ipairs (bufnrs ) do
918
+ -- If all BPs were removed from a buffer we must clear the buffer
919
+ -- by sending an empty table in the bufnr index
920
+ bps [b ] = bps [b ] or {}
921
+ end
915
922
session :set_breakpoints (bps )
916
923
end
917
924
end
You can’t perform that action at this time.
0 commit comments