Skip to content

Commit

Permalink
cider-overlays: Make Result truncated message more accurate
Browse files Browse the repository at this point in the history
If there's already a `*cider-inspect*` buffer visible, we shouldn't suggest the user to inspect the value again.
  • Loading branch information
vemv committed Mar 14, 2024
1 parent ddce948 commit 657b2d3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cider-overlays.el
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,13 @@ overlay."
;; string, since we want it to be at the first char.
(put-text-property 0 1 'cursor 0 display-string)
(when (> (string-width display-string) (* 3 (window-width)))
(setq display-string
(concat (substring display-string 0 (* 3 (window-width)))
(substitute-command-keys
"...\nResult truncated. Type `\\[cider-inspect-last-result]' to inspect it."))))
(let ((msg (if (cider--get-inspector-window)
(format "...\nResult truncated. It is currently visible in %s" cider-inspector-buffer)
"...\nResult truncated. Type `\\[cider-inspect-last-result]' to inspect it.")))
(setq display-string
(concat (substring display-string 0 (* 3 (window-width)))
(substitute-command-keys
msg)))))
;; Create the result overlay.
(setq o (apply #'cider--make-overlay
beg end type
Expand Down

0 comments on commit 657b2d3

Please sign in to comment.