From 2762a08a768667079fc34f93a9182520de0a7810 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 30 Jun 2019 14:26:18 +0200 Subject: [PATCH] highlight non-default indent despite whitespace-mode Before, a custom whitespace-style (or global-whitespace-mode) would disable doom|highlight-non-default-indentation (because they were incompatible). Now it injects itself into the current style, if one exists. --- core/core-ui.el | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/core-ui.el b/core/core-ui.el index 4ea93581e..ef48260c9 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -145,17 +145,16 @@ indent with tabs, spaces at BOL are highlighted. Does nothing if `whitespace-mode' is already active or the current buffer is read-only or not file-visiting." - (unless (or (bound-and-true-p global-whitespace-mode) - (bound-and-true-p whitespace-mode) - (eq major-mode 'fundamental-mode) + (unless (or (eq major-mode 'fundamental-mode) buffer-read-only (null buffer-file-name)) (require 'whitespace) (set (make-local-variable 'whitespace-style) - (if (bound-and-true-p whitespace-newline-mode) - (cl-union (if indent-tabs-mode '(indentation) '(tabs tab-mark)) - whitespace-style) - `(face ,@(if indent-tabs-mode '(indentation) '(tabs tab-mark))))) + (let ((style (if indent-tabs-mode '(indentation) '(tabs tab-mark)))) + (if whitespace-mode + (cl-union style whitespace-style) + `(face ,@style)))) + (add-to-list 'whitespace-style 'face) (whitespace-mode +1)))