From ef9d8fb2e8ade7508608674b2513ab986d40e47b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 6 Jun 2018 19:23:27 +0200 Subject: [PATCH] Don't trigger whitespace-mode if already on Normally doom|show-whitespace-maybe turns on whitespace-mode with a subset of its features when indent-tabs-mode was different in that buffer versus it's global default. e.g. If your default was spaces and you opened a file with tabs. This is to make it easier to notice whitespace style discrepancies. However, it have side effects if whitespace-mode/global-whitespace-mode was already on. --- core/core-ui.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/core-ui.el b/core/core-ui.el index c3fec02fa..ffb5585f8 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -341,7 +341,9 @@ DEFAULT is non-nil, set the default mode-line for all buffers." (defun doom|show-whitespace-maybe () "Show whitespace-mode when file has an `indent-tabs-mode' that is different from the default." - (unless (or (eq indent-tabs-mode (default-value 'indent-tabs-mode)) + (unless (or (bound-and-true-p global-whitespace-mode) + (bound-and-true-p whitespace-mode) + (eq indent-tabs-mode (default-value 'indent-tabs-mode)) (eq major-mode 'fundamental-mode) (derived-mode-p 'special-mode)) (require 'whitespace)