diff --git a/modules/completion/helm/autoload/posframe.el b/modules/completion/helm/autoload/posframe.el index efde5b1dc..daf0405f0 100644 --- a/modules/completion/helm/autoload/posframe.el +++ b/modules/completion/helm/autoload/posframe.el @@ -17,36 +17,18 @@ bottom, which is easier on the eyes on big displays." ;;;###autoload (defun +helm-posframe-display (buffer &optional _resume) "TODO" - (setq +helm--posframe-last-window (selected-window)) (require 'posframe) - (setq helm--buffer-in-new-frame-p t) + (setq +helm--posframe-last-window (selected-window) + helm--buffer-in-new-frame-p t) (posframe-show (setq +helm--posframe-buffer buffer) + :position (point) :poshandler +helm-posframe-handler - :internal-border-width +helm-posframe-border-width - :respect-header-line t - :respect-mode-line t - :width - (cond ((functionp helm-display-buffer-default-width) - (funcall helm-display-buffer-default-width)) - ((integerp helm-display-buffer-default-width) - helm-display-buffer-default-width) - ((floatp helm-display-buffer-default-width) - (truncate (* (frame-width) helm-display-buffer-default-width))) - ((min (max (truncate (* (frame-width) 0.8)) - 100) - 140))) - :height - (cond ((functionp helm-display-buffer-default-height) - (funcall helm-display-buffer-default-height)) - ((integerp helm-display-buffer-default-height) - helm-display-buffer-default-height) - ((floatp helm-display-buffer-default-height) - (truncate (* (frame-height) helm-display-buffer-default-height))) - ((truncate (* (frame-height) 0.4))))) - (when +helm-posframe-font-scale + :override-parameters +helm-posframe-parameters) + (unless (or (null +helm-posframe-text-scale) + (= +helm-posframe-text-scale 0)) (with-current-buffer buffer - (text-scale-set +helm-posframe-font-scale)))) + (text-scale-set +helm-posframe-text-scale)))) ;;;###autoload (defun +helm|posframe-cleanup () @@ -54,7 +36,10 @@ bottom, which is easier on the eyes on big displays." ;; Ensure the underlying window is switched to, to ensure that frame is given ;; proper focus; this gives the modeline a chance to refresh. (select-window +helm--posframe-last-window) - (setq +helm--posframe-last-frame nil) ;; (posframe-delete +helm--posframe-buffer)) + +;;;###autoload +(defun +helm*fix-get-font-height (orig-fn position) + (ignore-errors (funcall orig-fn position))) diff --git a/modules/completion/helm/config.el b/modules/completion/helm/config.el index 7d5203224..6dcecc793 100644 --- a/modules/completion/helm/config.el +++ b/modules/completion/helm/config.el @@ -20,13 +20,17 @@ This falls back to git-grep (then grep) if none of these available.") a cons cell representing the X and Y coordinates. See `posframe-poshandler-frame-center' as a reference.") -(defvar +helm-posframe-font-scale 1 +(defvar +helm-posframe-text-scale 1 "The text-scale to use in the helm childframe. Set to nil for no scaling. Can be negative.") -(defvar +helm-posframe-border-width 8 - "The text-scale to use in the helm childframe. Set to nil for no scaling. Can -be negative.") +(defvar +helm-posframe-parameters + '((internal-border-width . 8) + (min-width . 80) + (min-height . 16) + (width . 0.5) + (height . 0.55)) + "TODO") ;; @@ -78,11 +82,8 @@ be negative.") (when (and EMACS26+ (featurep! +childframe)) (setq helm-display-function #'+helm-posframe-display - helm-display-buffer-default-height 0.42 helm-echo-input-in-header-line t) ;; Fix "Specified window is not displaying the current buffer" error - (defun +helm*fix-get-font-height (orig-fn position) - (ignore-errors (funcall orig-fn position))) (advice-add #'posframe--get-font-height :around #'+helm*fix-get-font-height)) (let ((fuzzy (featurep! +fuzzy)))