Skip to content

Commit 05cd13b

Browse files
committed
Highlight regular expressions
1 parent 325d1e2 commit 05cd13b

7 files changed

Lines changed: 20 additions & 2 deletions

File tree

‎src/ace/mode/JavaScriptHighlightRules.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ JavaScriptHighlightRules = function() {
4646
regex : "\\/\\*",
4747
next : "comment"
4848
}, {
49-
token : "regex",
49+
token : "string.regexp",
5050
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/][gimy]*\\s*(?=[).;]|$)"
5151
}, {
5252
token : "string", // single line

‎src/ace/theme/Dawn.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ color:#B52A1D;\
127127
color:#0B6125;\
128128
}\
129129
\
130+
.ace-dawn .ace_string.ace_regexp {\
131+
color:#CF5628;\
132+
}\
133+
\
130134
.ace-dawn .ace_comment {\
131135
font-style:italic;\
132136
color:#5A525F;\

‎src/ace/theme/IdleFingers.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ background-color:#FF0000;\
123123
color:#A5C261;\
124124
}\
125125
\
126+
.ace-idle-fingers .ace_string.ace_regexp {\
127+
color:#CCCC33;\
128+
}\
129+
\
126130
.ace-idle-fingers .ace_comment {\
127131
font-style:italic;\
128132
color:#BC9458;\

‎src/ace/theme/Twilight.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ color:#D2A8A1;\
125125
color:#8F9D6A;\
126126
}\
127127
\
128+
.ace-twilight .ace_string.ace_regexp {\
129+
color:#E9C062;\
130+
}\
131+
\
128132
.ace-twilight .ace_comment {\
129133
font-style:italic;\
130134
color:#5F5A60;\

‎src/ace/theme/tm.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,6 @@
114114
background: rgb(232, 242, 254);
115115
}
116116

117-
.ace-tm .ace_regex {
117+
.ace-tm .ace_string.ace_regex {
118118
color: rgb(255, 0, 0)
119119
}

‎tool/Theme.tmpl.css‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@
119119
%string%
120120
}
121121

122+
.%cssClass% .ace_string.ace_regexp {
123+
%string.regexp%
124+
}
125+
122126
.%cssClass% .ace_comment {
123127
%comment%
124128
}

‎tool/tmtheme.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ var supportedScopes = {
7474
"invalid.deprecated": "invalid.deprecated",
7575

7676
"string": "string",
77+
"string.regexp": "string.regexp",
78+
7779
"comment": "comment",
7880
"comment.documentation": "comment.doc",
7981
"comment.documentation.tag": "comment.doc.tag",

0 commit comments

Comments
 (0)