[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu 67be3fb 3/6: Add corfu-bar-width/corfu-margin-wid
From: |
Protesilaos Stavrou |
Subject: |
[elpa] externals/corfu 67be3fb 3/6: Add corfu-bar-width/corfu-margin-width customizable variables |
Date: |
Thu, 29 Apr 2021 13:38:53 -0400 (EDT) |
branch: externals/corfu
commit 67be3fbda2325c9e93fcfaa4ac7d49ce88bb6da5
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Add corfu-bar-width/corfu-margin-width customizable variables
This allows to scale scrollbar and margins according to your preference.
Setting the width to 0 is supported. See #1 and #7.
---
corfu.el | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/corfu.el b/corfu.el
index 4607719..ffe41b1 100644
--- a/corfu.el
+++ b/corfu.el
@@ -65,6 +65,14 @@ Set to nil in order to disable confirmation."
"List of modes excluded by `corfu-global-mode'."
:type '(repeat symbol))
+(defcustom corfu-margin-width 0.6
+ "Width of the margin in units of the character width."
+ :type 'float)
+
+(defcustom corfu-bar-width 0.25
+ "Width of the bar in units of the character width."
+ :type 'float)
+
(defgroup corfu-faces nil
"Faces used by Corfu."
:group 'corfu
@@ -235,10 +243,13 @@ Set to nil in order to disable confirmation."
"Show LINES as popup at POS, with CURR highlighted and scrollbar from LO to
LO+BAR."
(let* ((cw (frame-char-width))
(ch (frame-char-height))
- (mw (ceiling cw 1.6))
+ (mw (ceiling (* cw corfu-margin-width)))
+ (bw (ceiling (* cw (min corfu-margin-width corfu-bar-width))))
(margin (propertize " " 'display `(space :width (,mw))))
- (align (propertize " " 'display `(space :align-to (- right (,(ceiling
cw 4))))))
- (sbar (propertize " " 'face 'corfu-bar 'display `(space :width
(,(ceiling cw 4)))))
+ (align (propertize " " 'display `(space :align-to (- right (,mw)))))
+ (sbar (concat
+ (propertize " " 'display `(space :width (,(- mw bw))))
+ (propertize " " 'face 'corfu-bar 'display `(space :width
(,bw)))))
(width (min (cdr corfu-width-limits)
(/ (frame-width) 2)
(apply #'max (car corfu-width-limits)
- [elpa] externals/corfu updated (f5b6c5d -> 17f3fc6), Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu bed9513 4/6: Add corfu-min/max-width for easier customization, Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu ec3e8cf 1/6: Print warning if corfu-mode is enabled on text display., Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu 67be3fb 3/6: Add corfu-bar-width/corfu-margin-width customizable variables,
Protesilaos Stavrou <=
- [elpa] externals/corfu 17f3fc6 6/6: Set child-frame-border on Emacs 28, Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu a97fca9 5/6: child frame: Anti-flicker fix, Protesilaos Stavrou, 2021/04/29
- [elpa] externals/corfu b8cd63f 2/6: Add error message when completion is already in progress, Protesilaos Stavrou, 2021/04/29