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

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

[elpa] master 3ce7df8 49/54: Truncate minibuffer prompts longer than win


From: Oleh Krehel
Subject: [elpa] master 3ce7df8 49/54: Truncate minibuffer prompts longer than window-width
Date: Tue, 29 Sep 2015 14:10:10 +0000

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

    Truncate minibuffer prompts longer than window-width
    
    * ivy.el (ivy--insert-prompt): When the prompt string is longer than the
      window width, truncate it to window width minus 26 chars.
    
    Fixes #240
---
 ivy.el |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/ivy.el b/ivy.el
index bfec0fe..dc17faa 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1294,6 +1294,8 @@ Insert .* between each char."
         (save-excursion
           (goto-char (point-min))
           (delete-region (point-min) (minibuffer-prompt-end))
+          (when (> (length n-str) (window-width))
+            (setq n-str (concat (substring n-str 0 (- (window-width) 30)) "... 
")))
           (set-text-properties 0 (length n-str)
                                `(face minibuffer-prompt ,@std-props)
                                n-str)



reply via email to

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