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

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

[nongnu] elpa/raku-mode 04988356e8 065/253: Don't highlight type constra


From: ELPA Syncer
Subject: [nongnu] elpa/raku-mode 04988356e8 065/253: Don't highlight type constraints inside strings/comments
Date: Sat, 29 Jan 2022 08:28:43 -0500 (EST)

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

    Don't highlight type constraints inside 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 74cf7e0787..ab7cfbb8f5 100644
--- a/perl6-font-lock.el
+++ b/perl6-font-lock.el
@@ -354,8 +354,13 @@ LIMIT can be used to bound the search."
                       (opt (group (symbol type-property))))))
    (lambda ()
      (goto-char (match-beginning 0))
-     (not (looking-back (rx (or (char ".^")
-                                (and line-start (0+ space)))))))
+     (let* ((state (syntax-ppss))
+            (in-string (nth 3 state))
+            (in-comment (nth 4 state)))
+       (not (or in-string
+                in-comment
+                (looking-back (rx (or (char ".^")
+                                      (and line-start (0+ space)))))))))
    limit))
 
 (defun perl6-fontify (groups)



reply via email to

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