Skip to content

Commit cb6186e

Browse files
danielmartintaku0
authored andcommitted
Add support for font-lock-negation-char-face
Emacs can show negation characters using a specific face in font-lock. This commit adds support for it in swift-mode.
1 parent ba4d981 commit cb6186e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

swift-mode-font-lock.el

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ Example: #if, #endif, and #selector."
138138
"Face for highlighting property accesses."
139139
:group 'swift-mode:faces)
140140

141+
(defface swift-mode:negation-char-face
142+
'((t . (:inherit font-lock-negation-char-face)))
143+
"Face for highlighting the negation char."
144+
:group 'swift-mode:faces)
141145

142146
(defun swift-mode:make-set (list)
143147
"Return a hash where its keys are elements of the LIST.
@@ -660,7 +664,12 @@ Excludes true, false, and keywords begin with a number sign.")
660664
;; Property accesses
661665
(swift-mode:font-lock-match-property-access
662666
.
663-
'swift-mode:property-access-face))
667+
'swift-mode:property-access-face)
668+
669+
;; Make negation chars easier to see
670+
("\\(?:^\\|[^[:alnum:]_]\\)\\(!+\\)[^=]"
671+
1
672+
'swift-mode:negation-char-face))
664673
"Swift mode keywords for Font Lock.")
665674

666675

0 commit comments

Comments
 (0)