Skip to content

Commit

Permalink
Keep log and expression breakpoints when removing breakpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
svaante committed Oct 13, 2023
1 parent 815a880 commit 819d4c3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions dape.el
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ Will remove log or expression breakpoint at line added with
`dape-log-breakpoint' and/or `dape-expression-breakpoint'."
(interactive)
(if (dape--breakpoints-at-point)
(dape-remove-breakpoint-at-point)
(dape-remove-breakpoint-at-point '(dape-log-message dape-expr-message))
(dape--place-breakpoint)))

(defun dape-log-breakpoint (log-message)
Expand Down Expand Up @@ -1117,10 +1117,11 @@ When EXPR-MESSAGE is evaluated as true threads will pause at current line."
(unless (string-empty-p expr-message)
(dape--place-breakpoint nil expr-message)))

(defun dape-remove-breakpoint-at-point ()
"Remove breakpoint, log breakpoint and expression at current line."
(defun dape-remove-breakpoint-at-point (&optional skip-types)
"Remove breakpoint, log breakpoint and expression at current line.
SKIP-TYPES is a list of overlay properties to skip removal of."
(interactive)
(dolist (breakpoint (dape--breakpoints-at-point))
(dolist (breakpoint (dape--breakpoints-at-point skip-types))
(dape--remove-breakpoint breakpoint)))

(defun dape-remove-all-breakpoints ()
Expand Down Expand Up @@ -1277,9 +1278,12 @@ Watched symbols are displayed in *dape-info* buffer.
(dape--overlay-region (eq (overlay-get overlay 'category)
'dape-stack-pointer))))

(defun dape--breakpoints-at-point ()
(defun dape--breakpoints-at-point (&optional skip-types)
(seq-filter (lambda (overlay)
(eq 'dape-breakpoint (overlay-get overlay 'category)))
(and (eq 'dape-breakpoint (overlay-get overlay 'category))
(not (cl-some (lambda (skip-type)
(overlay-get overlay skip-type))
skip-types))))
(overlays-in (line-beginning-position) (line-end-position))))

(defun dape--update-breakpoints-in-buffer (buffer)
Expand Down

0 comments on commit 819d4c3

Please sign in to comment.