summaryrefslogtreecommitdiff
path: root/cider-overlays.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2016-04-20 21:23:01 -0300
committerArtur Malabarba <bruce.connor.am@gmail.com>2016-04-20 21:27:27 -0300
commit030d6559623657756d5e8b7dbd6b5232cf23ddab (patch)
tree42678757dc18e9322443be51c7a24ac314fc7b6d /cider-overlays.el
parentb8091dd71a3ee183da321c759d5a396ec20d9eea (diff)
[Fix #1692] Truncate very long overlays
Diffstat (limited to 'cider-overlays.el')
-rw-r--r--cider-overlays.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/cider-overlays.el b/cider-overlays.el
index 2e052242..1c9ddb58 100644
--- a/cider-overlays.el
+++ b/cider-overlays.el
@@ -217,6 +217,11 @@ overlay."
;; Put the cursor property only once we're done manipulating the
;; 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."))))
;; Create the result overlay.
(setq o (apply #'cider--make-overlay
beg end type