fix(whitespace): update indent highlights after editorconfig

If editorconfig changed the indent settings after
`+whitespace-highlight-incorrect-indentation-h` fired, whitespace-mode
does not update its highlights, so it must be triggered manually.

Fix: #8573
Close: #8655
This commit is contained in:
Henrik Lissner 2026-02-12 23:07:47 -05:00
parent c7a1e2d70c
commit e68d23e73c
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -60,6 +60,14 @@ or if the current buffer is read-only or not file-visiting."
(cl-pushnew 'face whitespace-style) ; must be first
(whitespace-mode +1))))
;; Fix #8573: Editorconfig may change the tab-width or indent style later in a
;; file's init process, so whitespace-mode needs refreshing.
(add-hook! 'editorconfig-after-apply-functions :append
(defun +whitespace-highlight-incorrect-indentation-again-h (props)
(when (and (bound-and-true-p whitespace-mode) ; in case user disabled it
(gethash 'indent_style props))
(+whitespace-highlight-incorrect-indentation-h))))
:config
(setq whitespace-line-column nil
whitespace-style