diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2021-04-29 15:57:24 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2021-04-29 15:57:57 +0200 |
| commit | 67be3fbda2325c9e93fcfaa4ac7d49ce88bb6da5 (patch) | |
| tree | 66ed6029f8af92c3a18312a6ae30bcba44122c74 | |
| parent | b8cd63f1f85a50789279770c870fe1bcdb26665c (diff) | |
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.
| -rw-r--r-- | corfu.el | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -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) |
