summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2021-11-08 11:48:21 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2021-11-08 11:48:43 +0100
commit69407ed50dc51ab6d64a885ffca510ea92da4012 (patch)
tree28b9cdd00814f16296ffa293dc2f6a63a9016f1a
parent4585163bc262d7e4b86e2cadaebd7bcd0ad16ed3 (diff)
corfu--popup-show: Use default-font-width to determine character width
-rw-r--r--corfu.el4
1 files 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))))