@@ -505,6 +505,17 @@ REASON is a keyword describing why this buffer was necessary."
505
505
(search-forward-regexp (concat " \\ _<" (regexp-quote key) " \\ _>" )
506
506
limit 'noerror )))
507
507
508
+ (defun cider--debug-skip-ignored-forms ()
509
+ " Skip past all forms ignored with #_ reader macro."
510
+ ; ; Logic taken from `clojure--search-comment-macro-internal'
511
+ (while (looking-at (concat " [ ,\r\t\n ]*" clojure--comment-macro-regexp))
512
+ (let ((md (match-data ))
513
+ (start (match-beginning 1 )))
514
+ (goto-char start)
515
+ ; ; Count how many #_ we got and step by that many sexps
516
+ (clojure-forward-logical-sexp
517
+ (count-matches (rx " #_" ) (elt md 0 ) (elt md 1 ))))))
518
+
508
519
(defun cider--debug-move-point (coordinates )
509
520
" Place point on after the sexp specified by COORDINATES.
510
521
COORDINATES is a list of integers that specify how to navigate into the
@@ -579,7 +590,9 @@ key of a map, and it means \"go to the value associated with this key\"."
579
590
(pop coordinates))))))
580
591
; ; If that extra pop was the last coordinate, this represents the
581
592
; ; entire #(...), so we should move back out.
582
- (backward-up-list ))))
593
+ (backward-up-list )))
594
+ ; ; Finally skip past all #_ forms
595
+ (cider--debug-skip-ignored-forms))
583
596
; ; Place point at the end of instrumented sexp.
584
597
(clojure-forward-logical-sexp 1 ))
585
598
; ; Avoid throwing actual errors, since this happens on every breakpoint.
0 commit comments