mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-03-08 15:50:40 -07:00
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
This commit is contained in:
parent
8c5c6b570d
commit
62cd3bd176
1 changed files with 6 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue