[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu 37d4ed3ca0 9/9: Reduce popup width fluctuations
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu 37d4ed3ca0 9/9: Reduce popup width fluctuations |
Date: |
Tue, 5 Nov 2024 03:58:06 -0500 (EST) |
branch: externals/corfu
commit 37d4ed3ca0a7c314382af64bda643a9dbf31c469
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Reduce popup width fluctuations
---
CHANGELOG.org | 2 ++
corfu.el | 9 +++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.org b/CHANGELOG.org
index 91ed82bbb3..35871d1081 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -9,6 +9,8 @@
sure that the scroll bar cannot be pushed outside the child frame by the
content. This affects for example ~cape-emoji~.
- Improve suffix alignment.
+- Remember popup width during completion to avoid width fluctuations. Basically
+ the popup is only allowed to grow.
* Version 1.5 (2024-07-26)
diff --git a/corfu.el b/corfu.el
index 52fe631845..505d41cbb7 100644
--- a/corfu.el
+++ b/corfu.el
@@ -300,6 +300,9 @@ See also the settings `corfu-auto-delay',
`corfu-auto-prefix' and
(defvar corfu--frame nil
"Popup frame.")
+(defvar corfu--width 0
+ "Popup width of current completion to reduce width fluctuations.")
+
(defconst corfu--initial-state
(mapcar
(lambda (k) (cons k (symbol-value k)))
@@ -313,7 +316,8 @@ See also the settings `corfu-auto-delay',
`corfu-auto-prefix' and
corfu--total
corfu--preview-ov
corfu--change-group
- corfu--metadata))
+ corfu--metadata
+ corfu--width))
"Initial Corfu state.")
(defvar corfu--frame-parameters
@@ -740,8 +744,9 @@ FRAME is the existing frame."
(sw (cl-loop for x in cands maximize (string-width (caddr x))))
;; -4 because of margins and some additional safety
(max-width (min corfu-max-width (- (frame-width) 4)))
- (width (min (max corfu-min-width (+ pw cw sw)) max-width))
+ (width (min (max corfu--width corfu-min-width (+ pw cw sw))
max-width))
(trunc (not (display-graphic-p))))
+ (setq corfu--width width)
(list pw width
(cl-loop
for (cand prefix suffix) in cands collect
- [elpa] externals/corfu updated (44424e7d04 -> 37d4ed3ca0), ELPA Syncer, 2024/11/05
- [elpa] externals/corfu 08c3aeb46c 1/9: Avoid truncation if scrollbar is shown in the fringe, ELPA Syncer, 2024/11/05
- [elpa] externals/corfu 41ec0baa6b 2/9: Make right margin part of the fringe, ELPA Syncer, 2024/11/05
- [elpa] externals/corfu d7c2fabbc6 3/9: Fringe bitmaps have a width restriction 1 <= w <= 16, ELPA Syncer, 2024/11/05
- [elpa] externals/corfu a297daee27 4/9: Restrict the fringe width to 16, ELPA Syncer, 2024/11/05
- [elpa] externals/corfu 09e70155c2 5/9: Use the fringe symmetrically on both sides, ELPA Syncer, 2024/11/05
- [elpa] externals/corfu 94d95d2347 7/9: Move truncation back to corfu--format-candidates, ELPA Syncer, 2024/11/05
- [elpa] externals/corfu 23509b6fd3 8/9: Expand comment regarding HDPi systems, ELPA Syncer, 2024/11/05
- [elpa] externals/corfu dc85ee32eb 6/9: Preserve corfu-bar-width and corfu-bar face for compatibility, ELPA Syncer, 2024/11/05
- [elpa] externals/corfu 37d4ed3ca0 9/9: Reduce popup width fluctuations,
ELPA Syncer <=