completion/helm: refactor posframe config
This commit is contained in:
parent
7f5e778b0c
commit
860dff3e63
3 changed files with 86 additions and 25 deletions
|
@ -179,16 +179,21 @@ buffers.")
|
|||
;; Ensure modeline is inactive when Emacs is unfocused (and active otherwise)
|
||||
(defvar +modeline-remap-face-cookie nil)
|
||||
|
||||
(defun +modeline|focus ()
|
||||
(defun +modeline|focus (&rest _)
|
||||
(when +modeline-remap-face-cookie
|
||||
(require 'face-remap)
|
||||
(face-remap-remove-relative +modeline-remap-face-cookie)))
|
||||
(add-hook 'focus-in-hook #'+modeline|focus)
|
||||
|
||||
(defun +modeline|unfocus ()
|
||||
(defun +modeline|unfocus (&rest _)
|
||||
(setq +modeline-remap-face-cookie (face-remap-add-relative 'mode-line 'mode-line-inactive)))
|
||||
(add-hook 'focus-out-hook #'+modeline|unfocus)
|
||||
|
||||
(add-hook 'helm-after-initialize-hook #'+modeline|unfocus)
|
||||
|
||||
(advice-add #'posframe-hide :after #'+modeline|focus)
|
||||
(advice-add #'posframe-delete :after #'+modeline|focus)
|
||||
|
||||
|
||||
;;
|
||||
;; Helpers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue