Skip to content

Commit 35e356f

Browse files
monnierEli-Zaretskii
authored andcommitted
Fix font-lock of last character before EOB under 'whitespace-mode'
* lisp/whitespace.el (whitespace-color-on): Don't use OVERRIDE in font-lock-keywords; instead, use 'prepend' in the call to 'font-lock-add-keywords'. (Bug#73332)
1 parent 01ebe6d commit 35e356f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lisp/whitespace.el

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ This variable is used when `whitespace-style' includes
739739

740740
(defcustom whitespace-indentation-regexp
741741
'("^\t*\\(\\( \\{%d\\}\\)+\\)[^\n\t]"
742-
. "^ *\\(\t+\\)[^\n]")
742+
. "^ *\\(\t+\\).")
743743
"Regexps to match indentation whitespace that should be visualized.
744744
745745
The value should be a cons whose car specifies the regexp to match
@@ -1738,7 +1738,7 @@ cleaning up these problems."
17381738
((eq (car option) 'space-after-tab::space)
17391739
(whitespace-space-after-tab-regexp 'space))
17401740
((eq (car option) 'missing-newline-at-eof)
1741-
"[^\n]\\'")
1741+
".\\'")
17421742
(t
17431743
(cdr option)))))
17441744
(when (re-search-forward regexp rend t)
@@ -2174,14 +2174,14 @@ resultant list will be returned."
21742174
1 whitespace-space-after-tab t)))
21752175
,@(when (memq 'missing-newline-at-eof whitespace-active-style)
21762176
;; Show missing newline.
2177-
`(("[^\n]\\'" 0
2178-
;; Don't mark the end of the buffer is point is there --
2177+
`((".\\'" 0
2178+
;; Don't mark the end of the buffer if point is there --
21792179
;; it probably means that the user is typing something
21802180
;; at the end of the buffer.
21812181
(and (/= whitespace-point (point-max))
21822182
'whitespace-missing-newline-at-eof)
2183-
t)))))
2184-
(font-lock-add-keywords nil whitespace-font-lock-keywords t)
2183+
prepend)))))
2184+
(font-lock-add-keywords nil whitespace-font-lock-keywords 'append)
21852185
(font-lock-flush)))
21862186

21872187

0 commit comments

Comments
 (0)