summaryrefslogtreecommitdiff
path: root/cider-debug.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-07-14 14:25:36 +0100
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-07-14 14:51:31 +0100
commit6db1315db1671b787b08753372d9588eff8a497c (patch)
tree98c109ccaad6f3fabb71752c66d79526b456a73f /cider-debug.el
parent6b2e5af7d2938092cbd530c66acf0ae962ed43c4 (diff)
[Fix #1052] Use recursive-edit in debug-mode
Diffstat (limited to 'cider-debug.el')
-rw-r--r--cider-debug.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/cider-debug.el b/cider-debug.el
index bdc8c1e5..b3be41ec 100644
--- a/cider-debug.el
+++ b/cider-debug.el
@@ -303,8 +303,12 @@ In order to work properly, this mode must be activated by
(setq cider--debug-mode-commands-alist alist)
(dolist (it alist)
(define-key cider--debug-mode-map (vector (car it)) #'cider-debug-mode-send-reply)))
- ;; And show the prompt.
- (cider--debug-mode-redisplay))
+ ;; Show the prompt.
+ (cider--debug-mode-redisplay)
+ ;; If a sync request is ongoing, the user can't act normally to
+ ;; provide input, so we enter `recursive-edit'.
+ (when nrepl-ongoing-sync-request
+ (recursive-edit)))
(cider--debug-mode -1)
(if (called-interactively-p 'any)
(user-error (substitute-command-keys "Don't call this mode manually, use `\\[universal-argument] \\[cider-eval-defun-at-point]' instead"))
@@ -313,7 +317,9 @@ In order to work properly, this mode must be activated by
(run-at-time 0.3 nil #'cider--debug-remove-overlays (current-buffer))
(setq cider-interactive-eval-override nil)
(setq cider--debug-mode-commands-alist nil)
- (setq cider--debug-mode-response nil)))
+ (setq cider--debug-mode-response nil)
+ (when nrepl-ongoing-sync-request
+ (ignore-errors (exit-recursive-edit)))))
(defun cider--debug-remove-overlays (&optional buffer)
"Remove CIDER debug overlays from BUFFER if `cider--debug-mode' is nil."