branch: master
commit e03d96871e4d66a853343eec3856bed7fc3e58b7
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy--insert-prompt): Avoid negative length error
---
ivy.el | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/ivy.el b/ivy.el
index dc17faa..04c254e 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1295,7 +1295,9 @@ Insert .* between each char."
(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)) "...
")))
+ (setq n-str (concat (substring n-str 0
+ (max (- (window-width) 30)
+ 10)) "... ")))
(set-text-properties 0 (length n-str)
`(face minibuffer-prompt ,@std-props)
n-str)