From 62cd3bd176765821b7d33c22165485707fff14f3 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 14 Feb 2026 19:42:03 -0500 Subject: [PATCH] fix(indent-guides): inhibit in special buffers And removes redundant rule (now covered by the `doom-temp-buffer-p` check). Also fixes an issue where org-agenda loses fontification due to indent-bars-mode (#8681). Fix: #8681 --- modules/ui/indent-guides/config.el | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/ui/indent-guides/config.el b/modules/ui/indent-guides/config.el index 4a85cba41..676b92792 100644 --- a/modules/ui/indent-guides/config.el +++ b/modules/ui/indent-guides/config.el @@ -23,7 +23,6 @@ be enabled. If any function returns non-nil, the mode will not be activated." (defun +indent-guides-init-maybe-h () "Enable `indent-bars-mode' depending on `+indent-guides-inhibit-functions'." (unless (or (eq major-mode 'fundamental-mode) - (doom-temp-buffer-p (current-buffer)) (run-hook-with-args-until-success '+indent-guides-inhibit-functions)) (indent-bars-mode +1))) @@ -56,6 +55,11 @@ be enabled. If any function returns non-nil, the mode will not be activated." (add-hook 'doom-load-theme-hook #'indent-bars-reset-styles)) (add-hook! '+indent-guides-inhibit-functions + ;; Buffers that may have special fontification or may be invisible to the + ;; user. Particularly src blocks, org agenda, or special buffers like magit. + (defun +indent-guides-in-special-buffers-p () + (or (doom-special-buffer-p (current-buffer)) + (doom-temp-buffer-p (current-buffer)))) ;; Org's virtual indentation messes up indent-guides. (defun +indent-guides-in-org-indent-mode-p () (bound-and-true-p org-indent-mode)) @@ -68,13 +72,7 @@ be enabled. If any function returns non-nil, the mode will not be activated." ;; used for completion or eldoc popups). ;; REVIEW: Swap with `frame-parent' when 27 support is dropped (defun +indent-guides-in-childframe-p () - (frame-parameter nil 'parent-frame)) - ;; indent-guides in src blocks can cause syntax highlighting to fail - ;; abruptly for some major modes (particularly *-ts-modes or rustic-mode). - ;; Since it's already working on the super org buffer, it's redundant to let - ;; it work on the contents of each babel block. - (defun +indent-guides-in-org-src-block-p () - (string-prefix-p " *org-src-fontification:" (buffer-name)))) + (frame-parameter nil 'parent-frame))) ;; HACK: The way `indent-bars-display-on-blank-lines' functions, it places ;; text properties with a display property containing a newline, which