Disable indent guides in incompatible modes

e.g. visual-line-mode & org-indent-mode
This commit is contained in:
Henrik Lissner 2019-03-13 01:28:49 -04:00
parent a2fd7fc877
commit 29277c9b02
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -10,4 +10,11 @@
(defun +indent-guides-for-all-but-first-column (level responsive display) (defun +indent-guides-for-all-but-first-column (level responsive display)
(unless (< level 1) (unless (< level 1)
(highlight-indent-guides--highlighter-default level responsive display))) (highlight-indent-guides--highlighter-default level responsive display)))
(setq highlight-indent-guides-highlighter-function #'+indent-guides-for-all-but-first-column)) (setq highlight-indent-guides-highlighter-function #'+indent-guides-for-all-but-first-column)
(defun +indent-guides|disable-maybe ()
(when highlight-indent-guides
(highlight-indent-guides -1)))
;; `highlight-indent-guides' breaks in `visual-line-mode'
(add-hook 'visual-line-mode-hook #'+indent-guides|disable-maybe)
(add-hook 'org-indent-mode-hook #'+indent-guides|disable-maybe))