From e68d23e73cc82db4ea2617aa0f4efa9665d91de1 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 12 Feb 2026 23:07:47 -0500 Subject: [PATCH] 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 --- modules/editor/whitespace/config.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/editor/whitespace/config.el b/modules/editor/whitespace/config.el index 271144080..50cf5c9e2 100644 --- a/modules/editor/whitespace/config.el +++ b/modules/editor/whitespace/config.el @@ -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