From b34a542ca0691345a15bac876cc96fb590200303 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 6 Aug 2019 20:38:04 -0400 Subject: [PATCH] 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. --- core/core-ui.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/core-ui.el b/core/core-ui.el index 1dbbe766c..caa317600 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -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)))