A Regex file extension that makes it way easier to edit large regex.
made outer match lower opacity, maybe one day its possible to layer groups on top
1 file changed, +3 -2
+3-2src/highlighter.ts
| @@ -88,7 +88,9 @@ class Highlighter { | ||
| 88 | 88 | } |
| 89 | 89 | const start = document.positionAt(match.index); |
| 90 | 90 | const end = document.positionAt(match.index + match[0].length); |
| 91 | - this.updateOrCreateHighlightGroup("outer", new vscode.Range(start, end)); | |
| 91 | + this.updateOrCreateHighlightGroup("match", new vscode.Range(start, end), { | |
| 92 | + backgroundColor: "rgba(255, 255, 255, 0.1)", | |
| 93 | + }); | |
| 92 | 94 | for (const groupName in match.groups) { |
| 93 | 95 | // output.log(`Match: ${groupName}`); |
| 94 | 96 | const group = match.groups[groupName]; |
| @@ -125,7 +127,6 @@ class Highlighter { | ||
| 125 | 127 | } |
| 126 | 128 | |
| 127 | 129 | highlightMatches(editor: vscode.TextEditor) { |
| 128 | - // Apply other decorations first | |
| 129 | 130 | for (const key of Object.keys(this.highlightGroups)) { |
| 130 | 131 | const group = this.highlightGroups[key]; |
| 131 | 132 | editor.setDecorations(group.decorationType, group.decorations); |