don't display mismatched whitespace, bad in cpp mode with formatting

This commit is contained in:
outfoxxed 2025-07-24 20:50:06 -07:00
parent ad09b481ac
commit 25a87839f3
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

16
init.el
View file

@ -66,14 +66,14 @@
(setq tab-always-indent nil) ;; tab key inserts tabs after hitting indent point
;; display mismatched whitespace at the beginning or end of lines
(add-hook 'after-change-major-mode-hook
(lambda ()
(if (derived-mode-p 'prog-mode)
(progn
(if (eq indent-tabs-mode t)
(setq whitespace-style '(face indentation::tab trailing missing-newline-at-eof))
(setq whitespace-style '(face indentation::space trailing missing-newline-at-eof)))
(whitespace-mode t)))))
;; (add-hook 'after-change-major-mode-hook
;; (lambda ()
;; (if (derived-mode-p 'prog-mode)
;; (progn
;; (if (eq indent-tabs-mode t)
;; (setq whitespace-style '(face indentation::tab trailing missing-newline-at-eof))
;; (setq whitespace-style '(face indentation::space trailing missing-newline-at-eof)))
;; (whitespace-mode t)))))
(add-hook 'prog-mode-hook 'enable-tabs)
(add-hook 'lisp-mode-hook 'disable-tabs)