diff --git a/CHANGELOG.md b/CHANGELOG.md index e1631660a..8dec7138b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - [#3626](https://github.com/clojure-emacs/cider/issues/3626): `cider-ns-refresh`: jump to the relevant file/line on errors. - [#3628](https://github.com/clojure-emacs/cider/issues/3628): `cider-ns-refresh`: summarize errors as an overlay. +- [#3660](https://github.com/clojure-emacs/cider/issues/3660): Fix `cider-inspector-def-current-val` always defining in `user` namespace. - Bump the injected `enrich-classpath` to [1.19.3](https://github.com/clojure-emacs/enrich-classpath/compare/v1.19.0...v1.19.3). - Bump the injected nREPL to [1.1.1](https://github.com/nrepl/nrepl/blob/v1.1.1/CHANGELOG.md#111-2024-02-20). - Bump the injected `cider-nrepl` to [0.47.0](https://github.com/clojure-emacs/cider-nrepl/blob/v0.47.0/CHANGELOG.md#0470-2024-03-10). diff --git a/cider-inspector.el b/cider-inspector.el index f5bfe6f2c..8e2893045 100644 --- a/cider-inspector.el +++ b/cider-inspector.el @@ -575,6 +575,7 @@ instead of just its \"value\" entry." (nrepl-dict-get dict-or-value "doc-fragments"))) (block-tags (when v2 (nrepl-dict-get dict-or-value "doc-block-tags-fragments"))) + (ns (cider-current-ns)) (font-size (when-let* ((b (get-buffer cider-inspector-buffer)) (variable 'text-scale-mode-amount) (continue (local-variable-p variable b))) @@ -593,24 +594,25 @@ instead of just its \"value\" entry." :truncate-lines-defined truncate-lines-defined :truncate-lines-p truncate-lines-p :fragments fragments - :block-tags block-tags)) - (cider-popup-buffer-display cider-inspector-buffer cider-inspector-auto-select-buffer) - (when cider-inspector-fill-frame (delete-other-windows)) - (ignore-errors (cider-inspector-next-inspectable-object 1)) - (with-current-buffer cider-inspector-buffer - (when (eq cider-inspector-last-command 'cider-inspector-pop) - (setq cider-inspector-last-command nil) - ;; Prevents error message being displayed when we try to pop - ;; from the top-level of a data structure - (when cider-inspector-location-stack - (goto-char (pop cider-inspector-location-stack)))) - - (when (eq cider-inspector-last-command 'cider-inspector-prev-page) - (setq cider-inspector-last-command nil) - ;; Prevents error message being displayed when we try to - ;; go to a prev-page from the first page - (when cider-inspector-page-location-stack - (goto-char (pop cider-inspector-page-location-stack)))))) + :block-tags block-tags) + (cider-popup-buffer-display cider-inspector-buffer cider-inspector-auto-select-buffer) + (when cider-inspector-fill-frame (delete-other-windows)) + (ignore-errors (cider-inspector-next-inspectable-object 1)) + (with-current-buffer cider-inspector-buffer + (cider-set-buffer-ns ns) + (when (eq cider-inspector-last-command 'cider-inspector-pop) + (setq cider-inspector-last-command nil) + ;; Prevents error message being displayed when we try to pop + ;; from the top-level of a data structure + (when cider-inspector-location-stack + (goto-char (pop cider-inspector-location-stack)))) + + (when (eq cider-inspector-last-command 'cider-inspector-prev-page) + (setq cider-inspector-last-command nil) + ;; Prevents error message being displayed when we try to + ;; go to a prev-page from the first page + (when cider-inspector-page-location-stack + (goto-char (pop cider-inspector-page-location-stack))))))) (cl-defun cider-inspector-render (buffer str &key font-size truncate-lines-defined truncate-lines-p fragments block-tags) "Render STR in BUFFER."