Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Changes

- [#3777](https://github.com/clojure-emacs/cider/issues/3777): Inspector no longer displays parsed Javadoc for Java classes and members.
- [#3784](https://github.com/clojure-emacs/cider/issues/3784): Inspector: make point less erratic when navigating between inspector screens.

## 1.17.1 (2025-02-25)

Expand Down
29 changes: 18 additions & 11 deletions cider-connection.el
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,12 @@ function with the repl buffer set as current."
(user-error "No %s REPLs in current session \"%s\""
type (car (sesman-current-session 'CIDER)))))

(defvar-local cider--ancillary-buffer-repl nil
"Special buffer-local variable that contains reference to the REPL connection.
This should be set in ancillary CIDER buffers that originate from some
event (e.g. *cider-inspector*, *cider-error*) and which never change the
REPL (connection) which produced them.")

(defun cider-current-repl (&optional type ensure)
"Get the most recent REPL of TYPE from the current session.
TYPE is either clj, cljs, multi or any.
Expand All @@ -951,17 +957,18 @@ no linked session or there is no REPL of TYPE within the current session."
(eq cider-repl-type type)))
;; shortcut when in REPL buffer
(current-buffer)
(let* ((type (or type (cider-repl-type-for-buffer)))
(repls (cider-repls type ensure))
(repl (if (<= (length repls) 1)
(car repls)
;; pick the most recent one
(seq-find (lambda (b)
(member b repls))
(buffer-list)))))
(if (and ensure (null repl))
(cider--no-repls-user-error type)
repl)))))
(or cider--ancillary-buffer-repl
(let* ((type (or type (cider-repl-type-for-buffer)))
(repls (cider-repls type ensure))
(repl (if (<= (length repls) 1)
(car repls)
;; pick the most recent one
(seq-find (lambda (b)
(member b repls))
(buffer-list)))))
(if (and ensure (null repl))
(cider--no-repls-user-error type)
repl))))))

(defun cider--match-repl-type (type buffer)
"Return non-nil if TYPE matches BUFFER's REPL type."
Expand Down
3 changes: 1 addition & 2 deletions cider-debug.el
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,7 @@ needed. It is expected to contain at least \"key\", \"input-type\", and
(setq cider--debug-mode-response response)
(cider--debug-mode 1)))
(when inspect
(setq cider-inspector--current-repl (cider-current-repl))
(cider-inspector--render-value inspect)))
(cider-inspector--render-value inspect :next-inspectable)))
;; If something goes wrong, we send a "quit" or the session hangs.
(error (cider-debug-mode-send-reply ":quit" key)
(message "Error encountered while handling the debug message: %S" e)))))
Expand Down
Loading