Fix #2183: suppress so-long when no comment syntax

Hopefully a better solution can be found.
This commit is contained in:
Henrik Lissner 2019-12-13 14:55:50 -05:00
parent 7e0c093bcf
commit c0116d1447
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -501,7 +501,14 @@ files, so we replace calls to `pp' with the much faster `prin1'."
auto-composition-mode
undo-tree-mode
highlight-indent-guides-mode
hl-fill-column-mode)))
hl-fill-column-mode))
;; HACK Fix #2183: `so-long-detected-long-line-p' tries to parse comment
;; syntax, but in some buffers comment state isn't initialized, leading
;; to a wrong-type-argument: stringp error.
(defun doom-buffer-has-long-lines-p ()
(when (bound-and-true-p comment-use-syntax)
(so-long-detected-long-line-p)))
(setq so-long-predicate #'doom-buffer-has-long-lines-p))
(use-package! undo-tree