branch: master
commit 3ce7df8acb2da4c6b1a8e3d8c6ae724f487b9870
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>

    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