|
1 | | -using System; |
| 1 | +using System; |
2 | 2 | using System.Collections.Generic; |
3 | 3 | using System.Globalization; |
4 | 4 | using System.Linq; |
@@ -202,20 +202,27 @@ public HighlightingRuleSet MainRuleSet |
202 | 202 | {Foreground = new SimpleHighlightingBrush(Program.OptionsObject.SH_Methods)} |
203 | 203 | }); |
204 | 204 |
|
| 205 | + if (def.FieldStrings.Length > 0) |
| 206 | + rs.Rules.Add(new HighlightingRule //Methods |
| 207 | + { |
| 208 | + Regex = RegexKeywordsHelper.GetRegexFromKeywords2(def.FieldStrings), |
| 209 | + Color = new HighlightingColor |
| 210 | + {Foreground = new SimpleHighlightingBrush(Program.OptionsObject.SH_Methods)} |
| 211 | + }); |
| 212 | + |
205 | 213 | if (def.StructFieldStrings.Length > 0) |
206 | 214 | rs.Rules.Add(new HighlightingRule //Methods |
207 | 215 | { |
208 | | - Regex = RegexKeywordsHelper.GetRegexFromKeywords( |
209 | | - def.StructFieldStrings.Select(e => e).ToArray(), true), |
| 216 | + Regex = RegexKeywordsHelper.GetRegexFromKeywords2(def.StructFieldStrings), |
210 | 217 | Color = new HighlightingColor |
211 | 218 | {Foreground = new SimpleHighlightingBrush(Program.OptionsObject.SH_Methods)} |
212 | 219 | }); |
213 | 220 |
|
214 | 221 | if (def.StructMethodStrings.Length > 0) |
215 | 222 | rs.Rules.Add(new HighlightingRule //Methods |
216 | 223 | { |
217 | | - Regex = RegexKeywordsHelper.GetRegexFromKeywords( |
218 | | - def.StructMethodStrings.Select(e => e).ToArray(), true), |
| 224 | + Regex = RegexKeywordsHelper.GetRegexFromKeywords2( |
| 225 | + def.StructMethodStrings), |
219 | 226 | Color = new HighlightingColor |
220 | 227 | {Foreground = new SimpleHighlightingBrush(Program.OptionsObject.SH_Methods)} |
221 | 228 | }); |
@@ -370,7 +377,7 @@ public static string[] ConvertToAtomicRegexAbleStringArray(string[] keywords) |
370 | 377 |
|
371 | 378 | public static Regex GetRegexFromKeywords2(string[] keywords) |
372 | 379 | { |
373 | | - var regexBuilder = new StringBuilder(@"\b[^\s]+\.("); |
| 380 | + var regexBuilder = new StringBuilder(@"\b(?<=[^\s]+\.)("); |
374 | 381 | var i = 0; |
375 | 382 | foreach (var keyword in keywords) |
376 | 383 | { |
|
0 commit comments