Fix #2666: init indent-guides faces on first GUI frame

This commit is contained in:
Henrik Lissner 2020-03-31 16:30:30 -04:00
parent 84d2e67633
commit 5775714506
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -5,8 +5,20 @@
:init :init
(setq highlight-indent-guides-method 'character) (setq highlight-indent-guides-method 'character)
:config :config
(add-hook 'focus-in-hook #'highlight-indent-guides-auto-set-faces) (defun +indent-guides-init-faces-h ()
;; `highlight-indent-guides' breaks in these modes (when (display-graphic-p)
(highlight-indent-guides-auto-set-faces)))
;; HACK `highlight-indent-guides' calculates its faces from the current theme,
;; but is unable to do so properly in terminal Emacs, where it only has
;; access to 256 colors. So if the user uses a daemon we must wait for
;; the first graphical frame to be available to do.
(add-hook (if (daemonp)
'server-after-make-frame-hook
'doom-load-theme-hook)
#'+indent-guides-init-faces-h)
;; `highlight-indent-guides' breaks when `org-indent-mode' is active
(add-hook! 'org-indent-mode-hook (add-hook! 'org-indent-mode-hook
(defun +indent-guides-disable-maybe-h () (defun +indent-guides-disable-maybe-h ()
(when highlight-indent-guides-mode (when highlight-indent-guides-mode