emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/popup c0937ea 053/184: Truncate summary first, then string


From: ELPA Syncer
Subject: [nongnu] elpa/popup c0937ea 053/184: Truncate summary first, then string itself
Date: Wed, 6 Oct 2021 00:01:05 -0400 (EDT)

branch: elpa/popup
commit c0937eadd6018e05ec24a1d4cba504adf6587d34
Author: Takafumi Arakaki <aka.tkf@gmail.com>
Commit: Takafumi Arakaki <aka.tkf@gmail.com>

    Truncate summary first, then string itself
---
 popup.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/popup.el b/popup.el
index 8204ea9..703c1b9 100644
--- a/popup.el
+++ b/popup.el
@@ -404,10 +404,12 @@ usual."
 (defun* popup-create-line-string (popup string &key margin-left margin-right 
symbol summary)
   (let* ((popup-width (popup-width popup))
          (summary-width (string-width summary))
-         (content-width (- popup-width
-                           (if (> summary-width 0)
-                               (+ summary-width 2)
-                             0)))
+         (content-width (max
+                         (min popup-width (string-width string))
+                         (- popup-width
+                            (if (> summary-width 0)
+                                (+ summary-width 2)
+                              0))))
          (string (car (popup-substring-by-width string content-width)))
          (string-width (string-width string))
          (spacing (max (- popup-width string-width summary-width) 0)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]