branch: elpa/popup commit 52059d698494b0a0e48350aa98fb5e81d7bc8eed Merge: 4e8824e b8c1cb4 Author: Tomohiro Matsuyama <t...@cx4a.org> Commit: Tomohiro Matsuyama <t...@cx4a.org>
Merge pull request #24 from tkf/summary-overflow Summary overflow --- popup.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/popup.el b/popup.el index 34d3ad8..e4c79a7 100644 --- a/popup.el +++ b/popup.el @@ -404,17 +404,22 @@ 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))) + (spacing (max (- popup-width string-width summary-width) + (if (> popup-width string-width) 1 0)))) (concat margin-left string (make-string spacing ? ) - summary + (car + (popup-substring-by-width + summary (max (- popup-width string-width spacing) 0))) symbol margin-right)))