From 69407ed50dc51ab6d64a885ffca510ea92da4012 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Mon, 8 Nov 2021 11:48:21 +0100 Subject: corfu--popup-show: Use default-font-width to determine character width --- corfu.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/corfu.el b/corfu.el index 6918757..5f3f228 100644 --- a/corfu.el +++ b/corfu.el @@ -86,7 +86,7 @@ completion began less than that number of seconds ago." "List of modes excluded by `corfu-global-mode'." :type '(repeat symbol)) -(defcustom corfu-margin-width 0.4 +(defcustom corfu-margin-width 0.6 "Width of the margin in units of the character width." :type 'float) @@ -375,7 +375,7 @@ completion began less than that number of seconds ago." (defun corfu--popup-show (pos lines &optional curr lo bar) "Show LINES as popup at POS, with CURR highlighted and scrollbar from LO to LO+BAR." (let* ((ch (default-line-height)) - (cw (round (* ch (frame-char-width)) (frame-char-height))) + (cw (default-font-width)) (mw (ceiling (* cw corfu-margin-width))) (bw (ceiling (* cw (min corfu-margin-width corfu-bar-width)))) (margin (propertize " " 'display `(space :width (,mw)))) -- cgit v1.0