irongit

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

loads flags from global config

huncholanehuncholaneauthored
parent 95b4832commit d7b013cb948b741b6f4b2cb173596d51a7804b08Browse files

1 file changed, +12 -2

+12-2src/regexButtons.ts
@@ -60,12 +60,22 @@ class RegexButtons {
6060 }
6161
6262 activate(context: vscode.ExtensionContext) {
63+ this.loadConfigFlags();
6364 this.context = context;
6465 this.createButtons();
6566 }
6667
67- getFlags() {
68- return getConfig().get("flags") as string;
68+ getFlagString() {
69+ return Object.entries(this.flags)
70+ .filter(([_, flag]) => flag.state === "on")
71+ .map(([key, _]) => key)
72+ .join("");
73+ }
74+
75+ loadConfigFlags() {
76+ for (const flag of getConfig().get("flags") as FlagChar[]) {
77+ this.flags[flag].state = "on";
78+ }
6979 }
7080
7181 toggleFlag(flag: Flag) {