2019-03-11 12:39:38 -04:00
|
|
|
;;; ui/indent-guides/config.el -*- lexical-binding: t; -*-
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! highlight-indent-guides
|
2019-03-11 12:39:38 -04:00
|
|
|
:hook ((prog-mode text-mode conf-mode) . highlight-indent-guides-mode)
|
2019-03-11 16:46:55 -04:00
|
|
|
:init
|
2019-05-10 02:02:43 -04:00
|
|
|
(setq highlight-indent-guides-method 'character)
|
2019-03-11 16:46:55 -04:00
|
|
|
:config
|
2020-03-31 16:30:30 -04:00
|
|
|
(defun +indent-guides-init-faces-h ()
|
|
|
|
(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
|
2020-07-31 01:25:20 -04:00
|
|
|
(add-hook! 'org-mode-local-vars-hook
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +indent-guides-disable-maybe-h ()
|
2020-07-31 01:25:20 -04:00
|
|
|
(when (and highlight-indent-guides-mode org-indent-mode)
|
2019-07-18 15:27:20 +02:00
|
|
|
(highlight-indent-guides-mode -1)))))
|