diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2022-04-12 15:17:15 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2022-04-12 15:17:15 +0200 |
| commit | d816c2aa1e7da7dbcb06c78f5fbf89fd09f2b37e (patch) | |
| tree | eee09d08fc449389605304b013c222dad825423d | |
| parent | ad9047b09bfa7b7521d5566fb6f6315d248e9461 (diff) | |
Fix popup height if corfu-default face is modified (See #149)fix-height
| -rw-r--r-- | corfu.el | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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)))) |
