]> git.eshelyaron.com Git - emacs.git/commitdiff
whitespace: Include empty final line in BoB empty match
authorRichard Hansen <rhansen@rhansen.org>
Tue, 28 Jun 2022 19:05:04 +0000 (15:05 -0400)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 11 Sep 2022 11:46:30 +0000 (13:46 +0200)
* lisp/whitespace.el (whitespace-empty-at-bob-regexp): Include any
last line trailing whitespace in the BoB empty line match to ensure
that those characters get highlighted.

lisp/whitespace.el

index 4a8117b75e074cecd468f2a24435d85f47561db3..8146eff9b0a2760c4e93eea24755915beb72c708 100644 (file)
@@ -730,7 +730,7 @@ Used when `whitespace-style' includes `indentation',
   :group 'whitespace)
 
 
-(defcustom whitespace-empty-at-bob-regexp "\\`\\(\\([ \t]*\n\\)+\\)"
+(defcustom whitespace-empty-at-bob-regexp "\\`\\([ \t\n]*\\(?:\n\\|$\\)\\)"
   "Specify regexp for empty lines at beginning of buffer.
 
 Used when `whitespace-style' includes `empty'."