mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-03-09 00:01:45 -07:00
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:
parent
c7a1e2d70c
commit
e68d23e73c
1 changed files with 8 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue