From 4b978ffb75af2a4cd7859ccc829ccb4f86d8f3ff Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 12 Jul 2021 21:53:01 -0700 Subject: [PATCH] [oni-ivy] Display posframe in the center of the frame, not window --- oni-ivy.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/oni-ivy.el b/oni-ivy.el index c5600de..0022e96 100644 --- a/oni-ivy.el +++ b/oni-ivy.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0408.103313 +;; Version: 2021.0712.215209 ;; Package-Requires: (ivy oni-prescient oni-hydra ivy-hydra diminish ivy-posframe ivy-prescient) ;; This program is free software; you can redistribute it and/or modify @@ -42,6 +42,10 @@ (when ivy-enabled (ivy-mode 1))))) +(defun ivy-posframe-display-at-frame-bottom-center (str) + "Display STR in ivy’s posframe at the bottom centre of the current frame." + (ivy-posframe--display str #'posframe-poshandler-frame-bottom-center)) + (when (eq system-type 'windows-nt) (with-eval-after-load 'grep (add-function :around (symbol-function 'grep-read-files) @@ -50,6 +54,8 @@ (global-set-key (kbd "C-") 'ivy-push-view) (global-set-key (kbd "C-") 'ivy-switch-view) +(setq ivy-posframe-style 'frame-bottom-center) + ;;;###autoload (add-hook 'emacs-startup-hook 'ivy-mode)