@@ -343,7 +343,10 @@ In order to work properly, this mode must be activated by
343
343
(when nrepl-ongoing-sync-request
344
344
(ignore-errors (exit-recursive-edit )))))
345
345
346
+ ; ;; Bind the `:here` command to both h and H, because it behaves differently if
347
+ ; ;; invoked with an uppercase letter.
346
348
(define-key cider--debug-mode-map " h" #'cider-debug-move-here )
349
+ (define-key cider--debug-mode-map " H" #'cider-debug-move-here )
347
350
348
351
(defun cider--debug-remove-overlays (&optional buffer )
349
352
" Remove CIDER debug overlays from BUFFER if variable `cider--debug-mode' is nil."
@@ -383,6 +386,12 @@ In order to work properly, this mode must be activated by
383
386
[" List locals" cider-debug-toggle-locals :style toggle :selected cider-debug-display-locals])
384
387
[" Customize" (customize-group 'cider-debug )]))
385
388
389
+ (defun cider--uppercase-command-p ()
390
+ " Return true if the last command was uppercase letter."
391
+ (ignore-errors
392
+ (let ((case-fold-search nil ))
393
+ (string-match " [[:upper:]]" (string last-command-event)))))
394
+
386
395
(defun cider-debug-mode-send-reply (command &optional key force )
387
396
" Reply to the message that started current bufer's debugging session.
388
397
COMMAND is sent as the input option. KEY can be provided to reply to a
@@ -395,17 +404,15 @@ message."
395
404
(nrepl-dict-get cider--debug-mode-commands-dict
396
405
(downcase (string last-command-event)))))
397
406
nil
398
- (ignore-errors
399
- (let ((case-fold-search nil ))
400
- (string-match " [[:upper:]]" (string last-command-event))))))
407
+ (cider--uppercase-command-p)))
401
408
(unless (or (string-prefix-p " :" command)
402
409
(string-prefix-p " {" command))
403
410
(setq command (concat " :" command)))
411
+ (when (and (string-prefix-p " :" command) force)
412
+ (setq command (format " {:response %s :force? true} " command)))
404
413
(cider-nrepl-send-unhandled-request
405
- (append (list " op" " debug-input" " input" (or command " :quit" )
406
- " key" (or key (nrepl-dict-get cider--debug-mode-response " key" )))
407
- (when force
408
- '(" force?" " true" ))))
414
+ (list " op" " debug-input" " input" (or command " :quit" )
415
+ " key" (or key (nrepl-dict-get cider--debug-mode-response " key" ))))
409
416
(ignore-errors (cider--debug-mode -1 )))
410
417
411
418
(defun cider--debug-quit ()
@@ -693,9 +700,9 @@ TARGET is inside it. The returned list is suitable for use in
693
700
; ; `unwind-protect' clause.
694
701
(goto-char starting-point)))))
695
702
696
- (defun cider-debug-move-here ()
703
+ (defun cider-debug-move-here (&optional force )
697
704
" Skip any breakpoints up to point."
698
- (interactive )
705
+ (interactive ( list (cider--uppercase-command-p)) )
699
706
(unless cider--debug-mode
700
707
(user-error " `cider-debug-move-here' only makes sense during a debug session" ))
701
708
(let ((here (point )))
@@ -716,8 +723,9 @@ TARGET is inside it. The returned list is suitable for use in
716
723
(comment-forward (point-max ))
717
724
; ; Find the coordinate and send it.
718
725
(cider-debug-mode-send-reply
719
- (format " {:response :here, :coord %s } "
720
- (cider--debug-find-coordinates-for-point here))))))
726
+ (format " {:response :here, :coord %s :force? %s } "
727
+ (cider--debug-find-coordinates-for-point here)
728
+ (if force " true" " false" ))))))
721
729
722
730
723
731
; ;; User commands
0 commit comments