emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/corfu bed9513 4/6: Add corfu-min/max-width for easier c


From: Protesilaos Stavrou
Subject: [elpa] externals/corfu bed9513 4/6: Add corfu-min/max-width for easier customization
Date: Thu, 29 Apr 2021 13:38:53 -0400 (EDT)

branch: externals/corfu
commit bed95134c319d95466818f52ce4f0586c67d8c2c
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Add corfu-min/max-width for easier customization
---
 corfu.el | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/corfu.el b/corfu.el
index ffe41b1..b6c3688 100644
--- a/corfu.el
+++ b/corfu.el
@@ -47,10 +47,13 @@
   "Maximal number of candidates to show."
   :type 'integer)
 
-(defcustom corfu-width-limits
-  (cons 15 80)
-  "Popup width limits."
-  :type '(cons integer integer))
+(defcustom corfu-min-width 15
+  "Popup minimum width in characters."
+  :type 'integer)
+
+(defcustom corfu-max-width 100
+  "Popup maximum width in characters."
+  :type 'integer)
 
 (defcustom corfu-cycle nil
   "Enable cycling for `corfu-next' and `corfu-previous'."
@@ -250,9 +253,9 @@ Set to nil in order to disable confirmation."
          (sbar (concat
                 (propertize " " 'display `(space :width (,(- mw bw))))
                 (propertize " " 'face 'corfu-bar 'display `(space :width 
(,bw)))))
-         (width (min (cdr corfu-width-limits)
+         (width (min corfu-max-width
                      (/ (frame-width) 2)
-                     (apply #'max (car corfu-width-limits)
+                     (apply #'max corfu-min-width
                             (mapcar #'string-width lines))))
          (row 0)
          (pos (posn-x-y (posn-at-point pos))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]