-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit the maximum string size to be displayed in echo area #3661
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -304,10 +304,10 @@ Note that, while POINT can be a number, it's preferable to be a marker, as | |
that will better handle some corner cases where the original buffer is not | ||
focused." | ||
(cl-assert (symbolp value-type)) ;; We assert because for avoiding confusion with the optional args. | ||
(let* ((font-value (if cider-result-use-clojure-font-lock | ||
(let* ((value (string-trim-right value)) | ||
(font-value (if cider-result-use-clojure-font-lock | ||
(cider-font-lock-as-clojure value) | ||
value)) | ||
(font-value (string-trim-right font-value)) | ||
(used-overlay (when (and point | ||
cider-use-overlays | ||
(if (equal 'error value-type) | ||
|
@@ -316,10 +316,15 @@ focused." | |
(cider--make-result-overlay font-value | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, you meant trimming as in string-trim. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I didn't mean string-trim, but length trim
Alright then 👍 |
||
:where point | ||
:duration cider-eval-result-duration | ||
:prepend-face (or overlay-face 'cider-result-overlay-face))))) | ||
:prepend-face (or overlay-face 'cider-result-overlay-face)))) | ||
(msg (format "%s%s" cider-eval-result-prefix value)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems we need to print |
||
(max-msg-length (* (floor (max-mini-window-lines)) (frame-width))) | ||
(msg (if (> (string-width msg) max-msg-length) | ||
(format "%s..." (substring msg 0 (- max-msg-length 3))) | ||
msg))) | ||
(message | ||
"%s" | ||
(propertize (format "%s%s" cider-eval-result-prefix font-value) | ||
(propertize msg | ||
;; The following hides the message from the echo-area, but | ||
;; displays it in the Messages buffer. We only hide the message | ||
;; if the user wants to AND if the overlay succeeded. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably here
font-locked-value
would have been a better name, although depending on the config it might not be font-locked. Naming is hard...