[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu d20892abbc 2/8: format-candidates: ensure suffix
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu d20892abbc 2/8: format-candidates: ensure suffix is right-aligned when possible |
Date: |
Fri, 1 Nov 2024 12:58:24 -0400 (EDT) |
branch: externals/corfu
commit d20892abbc34dc4e92b9d93c157b47dd7cdfbc9e
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: Daniel Mendler <mail@daniel-mendler.de>
format-candidates: ensure suffix is right-aligned when possible
---
corfu.el | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/corfu.el b/corfu.el
index ea01161255..976a88e152 100644
--- a/corfu.el
+++ b/corfu.el
@@ -739,23 +739,16 @@ FRAME is the existing frame."
(width (+ pw cw sw))
;; -4 because of margins and some additional safety
(max-width (min corfu-max-width (- (frame-width) 4))))
- (when (> width max-width)
- (setq sw (max 0 (- max-width pw cw))
- width (+ pw cw sw)))
- (when (< width corfu-min-width)
- (setq cw (+ cw (- corfu-min-width width))
- width corfu-min-width))
- (setq width (min width max-width))
+ (setq width (min (max corfu-min-width width) max-width))
(list pw width
(cl-loop for (cand prefix suffix) in cands collect
(truncate-string-to-width
(concat
- prefix (make-string (max 0 (- pw (string-width prefix)))
?\s)
+ prefix (make-string (- pw (string-width prefix)) ?\s)
cand
- (when (/= sw 0)
- (make-string (+ (max 0 (- cw (string-width cand)))
- (max 0 (- sw (string-width suffix))))
- ?\s))
+ (make-string (max 1 (- width pw (string-width cand)
+ (string-width suffix)))
+ ?\s)
suffix)
width)))))
- [elpa] externals/corfu updated (16d5aef839 -> 2b81c26dd7), ELPA Syncer, 2024/11/01
- [elpa] externals/corfu 0afd1f7266 6/8: Force fringe update, ELPA Syncer, 2024/11/01
- [elpa] externals/corfu e7a22ac6d6 4/8: Use fringe for the scroll bar, ELPA Syncer, 2024/11/01
- [elpa] externals/corfu a0ac2861e9 3/8: Suffixes are always prefixed with space, ELPA Syncer, 2024/11/01
- [elpa] externals/corfu 38acda3546 5/8: Ensure right-margin-width >= bar-width, ELPA Syncer, 2024/11/01
- [elpa] externals/corfu d20892abbc 2/8: format-candidates: ensure suffix is right-aligned when possible,
ELPA Syncer <=
- [elpa] externals/corfu 090299074e 1/8: Use :extend=t for corfu-current, Simplify, ELPA Syncer, 2024/11/01
- [elpa] externals/corfu 2b81c26dd7 8/8: Fix corfu--popup-show: curr can be nil, ELPA Syncer, 2024/11/01
- [elpa] externals/corfu 1ad0336693 7/8: Update changelog, ELPA Syncer, 2024/11/01