Skip to content

Commit 66b577d

Browse files
committed
cider-overlays: Make Result truncated message more accurate
If there's already a `*cider-inspect*` buffer visible, we shouldn't suggest the user to inspect the value again.
1 parent e140417 commit 66b577d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cider-overlays.el

+7-4
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,13 @@ overlay."
252252
;; string, since we want it to be at the first char.
253253
(put-text-property 0 1 'cursor 0 display-string)
254254
(when (> (string-width display-string) (* 3 (window-width)))
255-
(setq display-string
256-
(concat (substring display-string 0 (* 3 (window-width)))
257-
(substitute-command-keys
258-
"...\nResult truncated. Type `\\[cider-inspect-last-result]' to inspect it."))))
255+
(let ((msg (if (cider--get-inspector-window)
256+
(format "...\nResult truncated. It is currently visible in %s" cider-inspector-buffer)
257+
"...\nResult truncated. Type `\\[cider-inspect-last-result]' to inspect it.")))
258+
(setq display-string
259+
(concat (substring display-string 0 (* 3 (window-width)))
260+
(substitute-command-keys
261+
msg)))))
259262
;; Create the result overlay.
260263
(setq o (apply #'cider--make-overlay
261264
beg end type

0 commit comments

Comments
 (0)