[gtksourceview] Fix a false positive in JavaScript regex highlighting



commit 8acd14f2bb6d22e98412a527c6e7f712e809fd9f
Author: Andreas Fackler <AndreasFackler gmx de>
Date:   Sun Apr 5 14:08:31 2015 +0300

    Fix a false positive in JavaScript regex highlighting
    
    Two division operations on one line, like
    
    a = [thing / thing, thing / thing]
    
    must not be highlighted as a regular expression (see bug 685885). To
    prevent cases like this, require that a regular expression is followed
    by a line break or a special character that can occur after a regex.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685885

 data/language-specs/javascript.lang |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/data/language-specs/javascript.lang b/data/language-specs/javascript.lang
index cd15040..4ac3406 100644
--- a/data/language-specs/javascript.lang
+++ b/data/language-specs/javascript.lang
@@ -73,7 +73,8 @@
           [^/]*
           \/
           \%{regex-opts}
-          ([),;.]|\s|$)
+          \s*
+          ([),;.\/\]:}]|$)
         )</start>
       <end>\/\%{regex-opts}</end>
       <include>


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