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.
This commit is contained in:
Henrik Lissner 2019-06-30 14:26:18 +02:00
parent 774956d809
commit 2762a08a76
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -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 Does nothing if `whitespace-mode' is already active or the current buffer is
read-only or not file-visiting." read-only or not file-visiting."
(unless (or (bound-and-true-p global-whitespace-mode) (unless (or (eq major-mode 'fundamental-mode)
(bound-and-true-p whitespace-mode)
(eq major-mode 'fundamental-mode)
buffer-read-only buffer-read-only
(null buffer-file-name)) (null buffer-file-name))
(require 'whitespace) (require 'whitespace)
(set (make-local-variable 'whitespace-style) (set (make-local-variable 'whitespace-style)
(if (bound-and-true-p whitespace-newline-mode) (let ((style (if indent-tabs-mode '(indentation) '(tabs tab-mark))))
(cl-union (if indent-tabs-mode '(indentation) '(tabs tab-mark)) (if whitespace-mode
whitespace-style) (cl-union style whitespace-style)
`(face ,@(if indent-tabs-mode '(indentation) '(tabs tab-mark))))) `(face ,@style))))
(add-to-list 'whitespace-style 'face)
(whitespace-mode +1))) (whitespace-mode +1)))