summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2022-04-12 15:17:15 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2022-04-12 15:17:15 +0200
commitd816c2aa1e7da7dbcb06c78f5fbf89fd09f2b37e (patch)
treeeee09d08fc449389605304b013c222dad825423d
parentad9047b09bfa7b7521d5566fb6f6315d248e9461 (diff)
Fix popup height if corfu-default face is modified (See #149)fix-height
-rw-r--r--corfu.el12
1 files 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))))