"Function to transform the list of candidates into a string.
This string will be inserted into the minibuffer.")
+(defun ivy--truncate-string (str width)
+ "Truncate STR to WIDTH."
+ (if (> (string-width str) width)
+ (concat (substring str 0 (min (- width 3)
+ (- (length str) 3))) "...")
+ str))
+
(defun ivy-format-function-default (cands)
"Transform CANDS into a string for minibuffer."
(if (bound-and-true-p truncate-lines)
(mapconcat
(if truncate-lines
(lambda (s)
- (if (> (length s) ww)
- (concat (substring s 0 (- ww 3)) "...")
- s))
+ (ivy--truncate-string s ww))
#'identity)
cands "\n"))))