* lisp/icomplete.el (icomplete-completions): Revise computation of
prospects-len (i) to avoid calling string-width on the entire
buffer-string, which could be slow; and (ii) to better handle minibuffer
prompts with embedded newlines (bug#72826).
(cherry picked from commit
a96954b982ddd441ac943bfa48015fb4775c00cb)
(or determ (concat open-bracket close-bracket)))
(string-width icomplete-separator)
(+ 2 (string-width ellipsis)) ;; take {…} into account
- (string-width (buffer-string))))
+ (string-width
+ (buffer-substring
+ (save-excursion
+ (goto-char (icomplete--field-beg))
+ (pos-bol))
+ (icomplete--field-end)))))
(prospects-max
;; Max total length to use, including the minibuffer content.
(* (+ icomplete-prospects-height