irongit

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

pressing the flag works instantly

huncholanehuncholaneauthored
parent 41349cdcommit ffcec983d5992a3c1ed30aa4bf98d531001c1881Browse files

2 files changed, +5 -1

+3-1src/highlighter.ts
@@ -47,7 +47,9 @@ class Highlighter {
4747 const highlightGroups: { [key: string]: HighlightGroup } = {
4848 outer: {
4949 ranges: [],
50- decoration: this.createDecoration({}),
50+ decoration: this.createDecoration({
51+ fontStyle: "italic",
52+ }),
5153 },
5254 };
5355 let i = 0;
+2-0src/regexButtons.ts
@@ -1,6 +1,7 @@
11 import * as vscode from "vscode";
22 import { getConfig } from "./global";
33 import { output } from "./output";
4+import { highlighter } from "./highlighter";
45
56 type FlagChar = "g" | "i" | "m" | "s" | "u" | "y" | "x";
67 type FlagState = "on" | "off";
@@ -82,6 +83,7 @@ class RegexButtons {
8283 // output.log(`Toggling flag ${flag.char}`);
8384 flag.state = flag.state === "on" ? "off" : "on";
8485 this.decorateFlag(flag);
86+ highlighter.run();
8587 }
8688
8789 decorateFlag(flag: Flag) {