fix: keep so-long out of special/temp buffers

Seems to be a new behavior on 30+ or 31+.
This commit is contained in:
Henrik Lissner 2025-11-04 22:15:35 -05:00
parent 073937d355
commit d9e444bb22
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -552,6 +552,15 @@ on."
(bound-and-true-p comment-use-syntax))) (bound-and-true-p comment-use-syntax)))
(so-long-detected-long-line-p)))) (so-long-detected-long-line-p))))
(setq so-long-predicate #'doom-buffer-has-long-lines-p)) (setq so-long-predicate #'doom-buffer-has-long-lines-p))
;; HACK: so-long triggers in places where we don't want it, like special
;; buffers (e.g. magit status) or temp buffers.
(defadvice! doom--exclude-special-modes-a (&rest _)
:before-while #'so-long-statistics-excessive-p
:before-while #'so-long-detected-long-line-p
(not (or (doom-temp-buffer-p (current-buffer))
(doom-special-buffer-p (current-buffer)))))
;; Don't disable syntax highlighting and line numbers, or make the buffer ;; Don't disable syntax highlighting and line numbers, or make the buffer
;; read-only, in `so-long-minor-mode', so we can have a basic editing ;; read-only, in `so-long-minor-mode', so we can have a basic editing
;; experience in them, at least. It will remain off in `so-long-mode', ;; experience in them, at least. It will remain off in `so-long-mode',