Skip to content

Commit 500e3fd

Browse files
committed
Use the inspect-toggle-pretty-print NREPL op
1 parent 8db6029 commit 500e3fd

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

cider-inspector.el

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ Can be turned to nil once the user sees and acknowledges the feature."
9797
:type 'boolean
9898
:package-version '(cider . "1.18.0"))
9999

100-
(defcustom cider-inspector-pretty-print nil
101-
"When true, pretty print values in the inspector."
102-
:type 'boolean
103-
:package-version '(cider . "1.18.0"))
104-
105100
(defvar cider-inspector-uninteresting-regexp
106101
(concat "nil" ; nils are not interesting
107102
"\\|:" clojure--sym-regexp ; nor keywords
@@ -358,10 +353,11 @@ MAX-NESTED-DEPTH is the new value."
358353
(defun cider-inspector-toggle-pretty-print ()
359354
"Toggle the pretty printing of values in the inspector."
360355
(interactive)
361-
(let ((pretty-print-p (not cider-inspector-pretty-print)))
362-
(setq cider-inspector-pretty-print pretty-print-p)
363-
(cider-inspector--refresh-with-opts "pretty-print" (if pretty-print-p "true" "false"))
364-
(message "Pretty printing in the inspector %s." (if pretty-print-p "enabled" "disabled"))))
356+
(let ((result (cider-nrepl-send-sync-request
357+
`("op" "inspect-toggle-pretty-print")
358+
(cider-current-repl))))
359+
(when (nrepl-dict-get result "value")
360+
(cider-inspector--render-value result))))
365361

366362
(defun cider-inspector-toggle-view-mode ()
367363
"Toggle the view mode of the inspector between normal and object view mode."

0 commit comments

Comments
 (0)