diff --git a/CHANGELOG.md b/CHANGELOG.md index 823892d38..8b1884165 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### New features +* [#1188](https://github.com/clojure-emacs/cider/pull/1188): New debugging tool-bar. * [#1187](https://github.com/clojure-emacs/cider/pull/1187): The list of keys displayed by the debugger can be configured with `cider-debug-prompt`. * [#1187](https://github.com/clojure-emacs/cider/pull/1187): While debugging, there is a menu on the menu-bar listing available commands. * [#1184](https://github.com/clojure-emacs/cider/pull/1184): When the user kills the repl buffer, CIDER will offer to kill the nrepl buffer and process too. Also, when the client (repl) process dies, the server (nrepl) process is killed too. diff --git a/cider-debug.el b/cider-debug.el index 728013cff..1d219f27b 100644 --- a/cider-debug.el +++ b/cider-debug.el @@ -285,6 +285,14 @@ of `cider-interactive-eval' in debug sessions." key) t)) +(defvar cider--debug-mode-tool-bar-map + (let ((tool-bar-map (make-sparse-keymap))) + (tool-bar-add-item "right-arrow" #'cider-debug-mode-send-reply :next :label "Next step") + (tool-bar-add-item "next-node" #'cider-debug-mode-send-reply :continue :label "Continue non-stop") + (tool-bar-add-item "jump-to" #'cider-debug-mode-send-reply :out :label "Out of sexp") + (tool-bar-add-item "exit" #'cider-debug-mode-send-reply :quit :label "Quit") + tool-bar-map)) + (defvar cider--debug-mode-map) (define-minor-mode cider--debug-mode @@ -295,6 +303,7 @@ In order to work properly, this mode must be activated by (if cider--debug-mode (if cider--debug-mode-response (nrepl-dbind-response cider--debug-mode-response (input-type) + (setq-local tool-bar-map cider--debug-mode-tool-bar-map) (unless (consp input-type) (error "debug-mode activated on a message not asking for commands: %s" cider--debug-mode-response)) ;; Integrate with eval commands. @@ -324,6 +333,7 @@ In order to work properly, this mode must be activated by (when (or (not buffer) (buffer-live-p buffer)) (with-current-buffer (or buffer (current-buffer)) (unless cider--debug-mode + (kill-local-variable 'tool-bar-map) (remove-overlays nil nil 'cider-type 'debug-result) (remove-overlays nil nil 'cider-type 'debug-code) (setq cider--debug-prompt-overlay nil) @@ -339,6 +349,7 @@ In order to work properly, this mode must be activated by `("CIDER DEBUGGER" ["Next step" (cider-debug-mode-send-reply ":next") :keys "n"] ["Continue non-stop" (cider-debug-mode-send-reply ":continue") :keys "c"] + ["Move out of sexp" (cider-debug-mode-send-reply ":out") :keys "o"] ["Quit" (cider-debug-mode-send-reply ":quit") :keys "q"] "--" ["Evaluate in current scope" (cider-debug-mode-send-reply ":eval") :keys "e"] @@ -359,9 +370,11 @@ In order to work properly, this mode must be activated by "Reply to the message that started current bufer's debugging session. COMMAND is sent as the input option. KEY can be provided to reply to a specific message." - (interactive (list (cdr (assq last-command-event - cider--debug-mode-commands-alist)) - nil)) + (interactive (list + (if (symbolp last-command-event) + (symbol-name last-command-event) + (cdr (assq last-command-event cider--debug-mode-commands-alist))) + nil)) (nrepl-send-request (list "op" "debug-input" "input" (or command ":quit") "key" (or key (nrepl-dict-get cider--debug-mode-response "key")))