irongit

A Regex file extension that makes it way easier to edit large regex.

results line up in editor now

huncholanehuncholaneauthored
parent 25f7bf7commit 4a282a837781300574b125e4e379adf046b34a31Browse files

1 file changed, +3 -7

+3-7src/highlighter.ts
@@ -101,18 +101,14 @@ class Highlighter {
101101 backgroundColor: "rgba(255, 255, 255, 0.1)",
102102 });
103103
104- let groupIndex = 1;
105104 for (const groupName in match.groups) {
106- // output.log(`Match: ${groupName}`);
107- const groupStartIndex = (match as any).indices[groupIndex][0];
108- const groupEndIndex = (match as any).indices[groupIndex][1];
109- const start = document.positionAt(groupStartIndex);
110- const end = document.positionAt(groupEndIndex);
105+ const groupIndices = (match as any).indices.groups[groupName];
106+ const start = document.positionAt(groupIndices[0]);
107+ const end = document.positionAt(groupIndices[1]);
111108 this.updateOrCreateHighlightGroup(
112109 groupName,
113110 new vscode.Range(start, end)
114111 );
115- groupIndex++;
116112 }
117113 i++;
118114 }