From d816c2aa1e7da7dbcb06c78f5fbf89fd09f2b37e Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Tue, 12 Apr 2022 15:17:15 +0200 Subject: Fix popup height if corfu-default face is modified (See #149) --- corfu.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/corfu.el b/corfu.el index 4352f14..b4b4b5e 100644 --- a/corfu.el +++ b/corfu.el @@ -462,8 +462,16 @@ The completion backend can override this with WIDTH is the width of the popup. The current candidate CURR is highlighted. A scroll bar is displayed from LO to LO+BAR." - (let* ((ch (default-line-height)) - (cw (default-font-width)) + (let* ((ch + ;; Use window-font-height instead and multiply with line spacing? + (let ((face-remapping-alist (copy-tree face-remapping-alist))) + (cl-pushnew 'corfu-default (alist-get 'default face-remapping-alist)) + (default-line-height))) + (cw + ;; Use window-font-width instead? + (let ((face-remapping-alist (copy-tree face-remapping-alist))) + (cl-pushnew 'corfu-default (alist-get 'default face-remapping-alist)) + (default-font-width))) (ml (ceiling (* cw corfu-left-margin-width))) (mr (ceiling (* cw corfu-right-margin-width))) (bw (ceiling (min mr (* cw corfu-bar-width)))) -- cgit v1.0