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

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

[elpa] master 1e739de 331/348: ivy-overlay.el (ivy-left-pad): Trim cands


From: Oleh Krehel
Subject: [elpa] master 1e739de 331/348: ivy-overlay.el (ivy-left-pad): Trim cands to window-width
Date: Sat, 8 Apr 2017 11:04:25 -0400 (EDT)

branch: master
commit 1e739de40f8c536da746f2df9e1e55407a08d660
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy-overlay.el (ivy-left-pad): Trim cands to window-width
---
 ivy-overlay.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ivy-overlay.el b/ivy-overlay.el
index 861d1f6..29e9980 100644
--- a/ivy-overlay.el
+++ b/ivy-overlay.el
@@ -39,7 +39,13 @@
 (defun ivy-left-pad (str width)
   "Pad STR from left with WIDTH spaces."
   (let ((padding (make-string width ?\ )))
-    (mapconcat (lambda (x) (concat padding x))
+    (mapconcat (lambda (x)
+                 (setq x (concat padding x))
+                 (if (> (length x) (window-width))
+                     (concat
+                      (substring x 0 (- (window-width) 4))
+                      "...")
+                   x))
                (split-string str "\n")
                "\n")))
 



reply via email to

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