Skip to content

Commit ee581a5

Browse files
Limit the maximum string size to be displayed in echo area
1 parent b421bbb commit ee581a5

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- [#3626](https://github.com/clojure-emacs/cider/issues/3626): `cider-ns-refresh`: jump to the relevant file/line on errors.
1919
- [#3628](https://github.com/clojure-emacs/cider/issues/3628): `cider-ns-refresh`: summarize errors as an overlay.
2020
- [#3660](https://github.com/clojure-emacs/cider/issues/3660): Fix `cider-inspector-def-current-val` always defining in `user` namespace.
21+
- [#3661](https://github.com/clojure-emacs/cider/issues/3661): Truncate echo area output ahead of time.
2122
- Bump the injected `enrich-classpath` to [1.19.3](https://github.com/clojure-emacs/enrich-classpath/compare/v1.19.0...v1.19.3).
2223
- Bump the injected nREPL to [1.1.1](https://github.com/nrepl/nrepl/blob/v1.1.1/CHANGELOG.md#111-2024-02-20).
2324
- Bump the injected `cider-nrepl` to [0.47.0](https://github.com/clojure-emacs/cider-nrepl/blob/v0.47.0/CHANGELOG.md#0470-2024-03-10).

cider-overlays.el

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,15 @@ focused."
316316
(cider--make-result-overlay font-value
317317
:where point
318318
:duration cider-eval-result-duration
319-
:prepend-face (or overlay-face 'cider-result-overlay-face)))))
319+
:prepend-face (or overlay-face 'cider-result-overlay-face))))
320+
(msg (format "%s%s" cider-eval-result-prefix value))
321+
(max-msg-length (* (floor (max-mini-window-lines)) (frame-width)))
322+
(msg (if (> (string-width msg) max-msg-length)
323+
(format "%s..." (substring msg 0 (- max-msg-length 3)))
324+
msg)))
320325
(message
321326
"%s"
322-
(propertize (format "%s%s" cider-eval-result-prefix font-value)
327+
(propertize msg
323328
;; The following hides the message from the echo-area, but
324329
;; displays it in the Messages buffer. We only hide the message
325330
;; if the user wants to AND if the overlay succeeded.

0 commit comments

Comments
 (0)