Fix over-eager whitespace-mode after switching major modes
Some major modes (like rust-mode) may trigger doom-highlight-non-default-indentation-h twice, causing whitespace-style to be set to its default global value, which (by default) enables whitespace-mode with all its features. This may overwhelm the unsuspecting user, so we instead only tack on our modifications to whitespace-style to its existing buffer-local value, rather than its global value.
This commit is contained in:
parent
1dcbdc8dfb
commit
b34a542ca0
1 changed files with 3 additions and 3 deletions
|
@ -141,9 +141,9 @@ read-only or not file-visiting."
|
|||
(set (make-local-variable 'whitespace-style)
|
||||
(let ((style (if indent-tabs-mode '(indentation) '(tabs tab-mark))))
|
||||
(if whitespace-mode
|
||||
(cl-union style (default-value 'whitespace-style))
|
||||
`(face ,@style))))
|
||||
(add-to-list 'whitespace-style 'face)
|
||||
(cl-union style whitespace-active-style)
|
||||
style)))
|
||||
(cl-pushnew 'face whitespace-style)
|
||||
(whitespace-mode +1)))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue