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

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

[elpa] master d374afe 31/54: Set truncate-lines in the minibuffer


From: Oleh Krehel
Subject: [elpa] master d374afe 31/54: Set truncate-lines in the minibuffer
Date: Tue, 29 Sep 2015 14:09:57 +0000

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

    Set truncate-lines in the minibuffer
    
    * ivy.el (ivy--minibuffer-setup): Update.
    (ivy-format-function-default): Check `truncate-lines'. Check if
    `fringe-mode' is bound.
    
    Fixes #223
---
 ivy.el |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/ivy.el b/ivy.el
index 8e5405b..30a4542 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1229,6 +1229,8 @@ Insert .* between each char."
   (set (make-local-variable 'minibuffer-default-add-function)
        (lambda ()
          (list ivy--default)))
+  (when (display-graphic-p)
+    (setq truncate-lines t))
   (setq-local max-mini-window-height ivy-height)
   (add-hook 'post-command-hook #'ivy--exhibit nil t)
   ;; show completions with empty input
@@ -1502,14 +1504,16 @@ This string will be inserted into the minibuffer.")
 
 (defun ivy-format-function-default (cands)
   "Transform CANDS into a string for minibuffer."
-  (let ((ww (- (window-width)
-               (if (eq fringe-mode 0) 1 0))))
-    (mapconcat
-     (lambda (s)
-       (if (> (length s) ww)
-           (concat (substring s 0 (- ww 3)) "...")
-         s))
-     cands "\n")))
+  (if (bound-and-true-p truncate-lines)
+      (mapconcat #'identity cands "\n")
+    (let ((ww (- (window-width)
+                 (if (and (boundp fringe-mode) (eq fringe-mode 0)) 1 0))))
+      (mapconcat
+       (lambda (s)
+         (if (> (length s) ww)
+             (concat (substring s 0 (- ww 3)) "...")
+           s))
+       cands "\n"))))
 
 (defun ivy-format-function-arrow (cands)
   "Transform CANDS into a string for minibuffer."



reply via email to

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