A Regex file extension that makes it way easier to edit large regex.
broke down the group highlighting
1 file changed, +4 -6
+4-6src/extension.ts
| @@ -147,12 +147,10 @@ function updateGroupMatches( | ||
| 147 | 147 | const groupMatch = match.groups[groupName]; |
| 148 | 148 | |
| 149 | 149 | if (groupMatch) { |
| 150 | - const startPos = textEditor.document.positionAt( | |
| 151 | - match.index + match[0].indexOf(groupMatch) | |
| 152 | - ); | |
| 153 | - const endPos = textEditor.document.positionAt( | |
| 154 | - match.index + match[0].indexOf(groupMatch) + groupMatch.length | |
| 155 | - ); | |
| 150 | + const startInd = match[0].indexOf(groupMatch); | |
| 151 | + const startPos = textEditor.document.positionAt(match.index + startInd); | |
| 152 | + const endInd = startInd + groupMatch.length; | |
| 153 | + const endPos = textEditor.document.positionAt(match.index + endInd); | |
| 156 | 154 | const matchRange = new vscode.Range(startPos, endPos); |
| 157 | 155 | |
| 158 | 156 | if (!groupMatches[groupName]) { |