emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/swift-mode cb6186e 474/496: Add support for font-lock-nega


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode cb6186e 474/496: Add support for font-lock-negation-char-face
Date: Sun, 29 Aug 2021 11:34:31 -0400 (EDT)

branch: elpa/swift-mode
commit cb6186e4b180317d98cc83ab5d6c55914b0ac222
Author: Daniel Martín <mardani29@yahoo.es>
Commit: taku0 <taku0@users.noreply.github.com>

    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.
---
 swift-mode-font-lock.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/swift-mode-font-lock.el b/swift-mode-font-lock.el
index 398cfed..da32425 100644
--- a/swift-mode-font-lock.el
+++ b/swift-mode-font-lock.el
@@ -138,6 +138,10 @@ Example: #if, #endif, and #selector."
   "Face for highlighting property accesses."
   :group 'swift-mode:faces)
 
+(defface swift-mode:negation-char-face
+  '((t . (:inherit font-lock-negation-char-face)))
+  "Face for highlighting the negation char."
+  :group 'swift-mode:faces)
 
 (defun swift-mode:make-set (list)
   "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.")
     ;; Property accesses
     (swift-mode:font-lock-match-property-access
      .
-     'swift-mode:property-access-face))
+     'swift-mode:property-access-face)
+
+    ;; Make negation chars easier to see
+    ("\\(?:^\\|[^[:alnum:]_]\\)\\(!+\\)[^=]"
+     1
+     'swift-mode:negation-char-face))
   "Swift mode keywords for Font Lock.")
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]