branch: externals/ivy-posframe commit 0f159d505fc9cc7aebbe7c0cf53840d7ac7a236d Author: Feng Shu <tuma...@163.com> Commit: Feng Shu <tuma...@163.com>
Add frame-bottom-window-center style --- README.md | 19 ++++++++++--------- ivy-posframe.el | 10 +++++++++- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f5e5c1b..513eea6 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ # 目录 -1. [ivy-posframe README](#org31b7799) - 1. [What is ivy-posframe](#orge59727b) - 2. [Display functions](#orgf8e0e78) - 3. [How to enable ivy-posframe](#orgd1a99ab) +1. [ivy-posframe README](#org607d67c) + 1. [What is ivy-posframe](#org9e02c4f) + 2. [Display functions](#org050c36b) + 3. [How to enable ivy-posframe](#org0a6499b) -<a id="org31b7799"></a> +<a id="org607d67c"></a> # ivy-posframe README -<a id="orge59727b"></a> +<a id="org9e02c4f"></a> ## What is ivy-posframe @@ -22,7 +22,7 @@ to show its candidate menu. NOTE: ivy-posframe requires Emacs 26 -<a id="orgf8e0e78"></a> +<a id="org050c36b"></a> ## Display functions @@ -33,11 +33,12 @@ NOTE: ivy-posframe requires Emacs 26 4. ivy-posframe-display-at-frame-bottom-left 5. ivy-posframe-display-at-window-bottom-left  -6. ivy-posframe-display-at-point +6. ivy-posframe-display-at-frame-bottom-window-center +7. ivy-posframe-display-at-point  -<a id="orgd1a99ab"></a> +<a id="org0a6499b"></a> ## How to enable ivy-posframe diff --git a/ivy-posframe.el b/ivy-posframe.el index 74b2c17..cb748af 100644 --- a/ivy-posframe.el +++ b/ivy-posframe.el @@ -43,7 +43,8 @@ ;; 4. ivy-posframe-display-at-frame-bottom-left ;; 5. ivy-posframe-display-at-window-bottom-left ;; [[./snapshots/ivy-posframe-display-at-window-bottom-left.gif]] -;; 6. ivy-posframe-display-at-point +;; 6. ivy-posframe-display-at-frame-bottom-window-center +;; 7. ivy-posframe-display-at-point ;; [[./snapshots/ivy-posframe-display-at-point.gif]] ;; ** How to enable ivy-posframe @@ -98,6 +99,7 @@ ivy-posframe-display-at-window-center ivy-posframe-display-at-frame-bottom-left ivy-posframe-display-at-window-bottom-left + ivy-posframe-display-at-frame-bottom-window-center ivy-posframe-display-at-point)) (push `(,f :cleanup ivy-posframe-cleanup) ivy-display-functions-props)) @@ -131,6 +133,9 @@ When nil, Using current frame's font as fallback." (frame-center . posframe-poshandler-frame-center) (window-bottom-left . posframe-poshandler-window-bottom-left-corner) (frame-bottom-left . posframe-poshandler-frame-bottom-left-corner) + (frame-bottom-window-center . (lambda (info) + (cons (car (posframe-poshandler-window-center info)) + (cdr (posframe-poshandler-frame-bottom-left-corner info))))) (point . posframe-poshandler-point-bottom-left-corner)) "Alist of ivy posframe styles.") @@ -169,6 +174,9 @@ When nil, Using current frame's font as fallback." (defun ivy-posframe-display-at-frame-bottom-left (str) (ivy-posframe-display str 'frame-bottom-left)) +(defun ivy-posframe-display-at-frame-bottom-window-center (str) + (ivy-posframe-display str 'frame-bottom-window-center)) + (defun ivy-posframe-display-at-point (str) (ivy-posframe-display str 'point))