diff options
| author | Gregory Heytings | 2022-11-28 12:17:30 +0000 |
|---|---|---|
| committer | Gregory Heytings | 2022-11-28 13:18:37 +0100 |
| commit | 6deeda411c0d2e25eab68ec4c2dccb626937e375 (patch) | |
| tree | d331cbe325a7593bf439a71c159168b43b35786d | |
| parent | 264e9e3a1776b7c1a864022c78d74c911d4fe9d1 (diff) | |
| download | emacs-6deeda411c0d2e25eab68ec4c2dccb626937e375.tar.gz emacs-6deeda411c0d2e25eab68ec4c2dccb626937e375.zip | |
Fix display of long completions.
* 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.
| -rw-r--r-- | lisp/minibuffer.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 6bb0fa3ae98..5faa3c8d4e8 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -2025,8 +2025,8 @@ Runs of equal candidate strings are eliminated. GROUP-FUN is a | |||
| 2025 | (window (get-buffer-window (current-buffer) 0)) | 2025 | (window (get-buffer-window (current-buffer) 0)) |
| 2026 | (wwidth (if window (1- (window-width window)) 79)) | 2026 | (wwidth (if window (1- (window-width window)) 79)) |
| 2027 | (columns (min | 2027 | (columns (min |
| 2028 | ;; At least 2 columns; at least 2 spaces between columns. | 2028 | ;; At least 2 spaces between columns. |
| 2029 | (max 2 (/ wwidth (+ 2 length))) | 2029 | (max 1 (/ wwidth (+ 2 length))) |
| 2030 | ;; Don't allocate more columns than we can fill. | 2030 | ;; Don't allocate more columns than we can fill. |
| 2031 | ;; Windows can't show less than 3 lines anyway. | 2031 | ;; Windows can't show less than 3 lines anyway. |
| 2032 | (max 1 (/ (length strings) 2)))) | 2032 | (max 1 (/ (length strings) 2)))) |