A Regex file extension that makes it way easier to edit large regex.
pressing the flag works instantly
2 files changed, +5 -1
+3-1src/highlighter.ts
| @@ -47,7 +47,9 @@ class Highlighter { | ||
| 47 | 47 | const highlightGroups: { [key: string]: HighlightGroup } = { |
| 48 | 48 | outer: { |
| 49 | 49 | ranges: [], |
| 50 | - decoration: this.createDecoration({}), | |
| 50 | + decoration: this.createDecoration({ | |
| 51 | + fontStyle: "italic", | |
| 52 | + }), | |
| 51 | 53 | }, |
| 52 | 54 | }; |
| 53 | 55 | let i = 0; |
+2-0src/regexButtons.ts
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | import * as vscode from "vscode"; |
| 2 | 2 | import { getConfig } from "./global"; |
| 3 | 3 | import { output } from "./output"; |
| 4 | +import { highlighter } from "./highlighter"; | |
| 4 | 5 | |
| 5 | 6 | type FlagChar = "g" | "i" | "m" | "s" | "u" | "y" | "x"; |
| 6 | 7 | type FlagState = "on" | "off"; |
| @@ -82,6 +83,7 @@ class RegexButtons { | ||
| 82 | 83 | // output.log(`Toggling flag ${flag.char}`); |
| 83 | 84 | flag.state = flag.state === "on" ? "off" : "on"; |
| 84 | 85 | this.decorateFlag(flag); |
| 86 | + highlighter.run(); | |
| 85 | 87 | } |
| 86 | 88 | |
| 87 | 89 | decorateFlag(flag: Flag) { |