Skip to content

Commit e3845b0

Browse files
committed
fix(highlight-pattern): organize level correctly
1 parent 2c4bced commit e3845b0

File tree

1 file changed

+19
-18
lines changed
  • feature/matcher/src/commonMain/kotlin/com/neoutils/neoregex/feature/matcher/model

1 file changed

+19
-18
lines changed

feature/matcher/src/commonMain/kotlin/com/neoutils/neoregex/feature/matcher/model/Syntax.kt

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,10 @@ interface Syntax {
6666
override val highlight = Highlight {
6767
spanStyle {
6868

69-
groupRegex.match {
69+
escapeReservedRegex.match {
7070

71-
// charset
72-
put(5, groupSpanStyle)
73-
put(6, groupSpanStyle.copy(color = Color.Unspecified))
74-
put(7, groupSpanStyle)
71+
// full match
72+
put(0, SpanStyle(color = escapeReservedColor))
7573
}
7674

7775
modifierRegex.match {
@@ -92,19 +90,6 @@ interface Syntax {
9290
put(5, SpanStyle(color = groupColor))
9391
}
9492

95-
charSetRegex.match {
96-
97-
// charset
98-
put(3, charSetSpanStyle)
99-
put(4, charSetSpanStyle.copy(color = Color.Unspecified))
100-
put(5, charSetSpanStyle)
101-
}
102-
103-
escapeReservedRegex.match {
104-
105-
// full match
106-
put(0, SpanStyle(color = escapeReservedColor))
107-
}
10893

10994
controlsRegex.match {
11095

@@ -124,6 +109,22 @@ interface Syntax {
124109
put(3, SpanStyle(color = anchorsColor))
125110
put(4, SpanStyle(color = anchorsColor))
126111
}
112+
113+
groupRegex.match {
114+
115+
// charset
116+
put(5, groupSpanStyle)
117+
put(6, groupSpanStyle.copy(color = Color.Unspecified))
118+
put(7, groupSpanStyle)
119+
}
120+
121+
charSetRegex.match {
122+
123+
// charset
124+
put(3, charSetSpanStyle)
125+
put(4, charSetSpanStyle.copy(color = Color.Unspecified))
126+
put(5, charSetSpanStyle)
127+
}
127128
}
128129

129130
groupRegex.script { match ->

0 commit comments

Comments
 (0)