]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix display of long completions.
authorGregory Heytings <gregory@heytings.org>
Mon, 28 Nov 2022 12:17:30 +0000 (12:17 +0000)
committerGregory Heytings <gregory@heytings.org>
Mon, 28 Nov 2022 12:18:37 +0000 (13:18 +0100)
* lisp/minibuffer.el (completion--insert-strings): Do not assume
"at least 2 columns", which is not possible when completion
strings are long, e.g. with completions-detailed set.

lisp/minibuffer.el

index 6bb0fa3ae98b17a4db44130359b90b1fb59fd4e8..5faa3c8d4e8940d363281b1295ca31f7b94591c7 100644 (file)
@@ -2025,8 +2025,8 @@ Runs of equal candidate strings are eliminated.  GROUP-FUN is a
           (window (get-buffer-window (current-buffer) 0))
           (wwidth (if window (1- (window-width window)) 79))
           (columns (min
-                    ;; At least 2 columns; at least 2 spaces between columns.
-                    (max 2 (/ wwidth (+ 2 length)))
+                    ;; At least 2 spaces between columns.
+                    (max 1 (/ wwidth (+ 2 length)))
                     ;; Don't allocate more columns than we can fill.
                     ;; Windows can't show less than 3 lines anyway.
                     (max 1 (/ (length strings) 2))))