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

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

[nongnu] elpa/raku-mode a01e71cde7 081/253: Avoid highlighting numbers a


From: ELPA Syncer
Subject: [nongnu] elpa/raku-mode a01e71cde7 081/253: Avoid highlighting numbers and type constraints in strings/comments
Date: Sat, 29 Jan 2022 08:28:44 -0500 (EST)

branch: elpa/raku-mode
commit a01e71cde720e2e2575a37e0f126cfeb5d732e10
Author: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
Commit: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>

    Avoid highlighting numbers and type constraints in strings/comments
---
 perl6-font-lock.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/perl6-font-lock.el b/perl6-font-lock.el
index 7b801951c3..8c0c446517 100644
--- a/perl6-font-lock.el
+++ b/perl6-font-lock.el
@@ -435,8 +435,13 @@ GROUPS is allowed to reference optional match groups."
     (let ((group-num (car group))
           (group-face (cdr group)))
       (when (match-string group-num)
-        (put-text-property (match-beginning group-num) (match-end group-num)
-                           'face group-face)))))
+        (let* ((state (save-excursion
+                        (syntax-ppss (match-beginning group-num))))
+               (in-string (nth 3 state))
+               (in-comment (nth 4 state)))
+          (unless (or in-string in-comment)
+            (put-text-property (match-beginning group-num) (match-end 
group-num)
+                               'face group-face)))))))
 
 (defun perl6-match-property (property context limit)
   (when (symbolp context)



reply via email to

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