From 66b577d5bf1f2522bf40b90b7c99da801692d766 Mon Sep 17 00:00:00 2001 From: vemv Date: Thu, 14 Mar 2024 08:44:03 +0100 Subject: [PATCH] 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. --- cider-overlays.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cider-overlays.el b/cider-overlays.el index 6310bb0d3..f487716e7 100644 --- a/cider-overlays.el +++ b/cider-overlays.el @@ -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