diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 64f7046..929be33 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -8,13 +8,13 @@ "name": "modalfilemanager", "version": "1.0.0", "dependencies": { - "svelte-color-picker": "^1.0.7", "svelte-icons": "^2.1.0" }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^2.0.2", "svelte": "^3.55.1", - "vite": "^4.1.1" + "svelte-awesome-color-picker": "^2.4.1", + "vite": "^4.1.2" } }, "node_modules/@esbuild/android-arm": { @@ -375,11 +375,6 @@ "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", "dev": true }, - "node_modules/@polka/url": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-0.5.0.tgz", - "integrity": "sha512-oZLYFEAzUKyi3SKnXvj32ZCEGH6RDnao7COuCVhDydMS9NrCSVXhM79VaKyP5+Zc33m0QXEd2DN3UkU7OsHcfw==" - }, "node_modules/@sveltejs/vite-plugin-svelte": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.0.2.tgz", @@ -401,13 +396,11 @@ "vite": "^4.0.0" } }, - "node_modules/console-clear": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/console-clear/-/console-clear-1.1.1.tgz", - "integrity": "sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==", - "engines": { - "node": ">=4" - } + "node_modules/colord": { + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", + "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", + "dev": true }, "node_modules/debug": { "version": "4.3.4", @@ -492,14 +485,6 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "node_modules/get-port": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", - "integrity": "sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==", - "engines": { - "node": ">=4" - } - }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -533,14 +518,6 @@ "node": ">=6" } }, - "node_modules/local-access": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/local-access/-/local-access-1.1.0.tgz", - "integrity": "sha512-XfegD5pyTAfb+GY6chk283Ox5z8WexG56OvM06RWLpAc/UHozO8X6xAxEkIitZOtsSMM1Yr3DkHgW5W+onLhCw==", - "engines": { - "node": ">=6" - } - }, "node_modules/magic-string": { "version": "0.27.0", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz", @@ -553,25 +530,6 @@ "node": ">=12" } }, - "node_modules/mime": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - "engines": { - "node": ">=4" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -659,57 +617,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/sade": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", - "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", - "dependencies": { - "mri": "^1.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/sirv": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-0.4.6.tgz", - "integrity": "sha512-rYpOXlNbpHiY4nVXxuDf4mXPvKz1reZGap/LkWp9TvcZ84qD/nPBjjH/6GZsgIjVMbOslnY8YYULAyP8jMn1GQ==", - "dependencies": { - "@polka/url": "^0.5.0", - "mime": "^2.3.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/sirv-cli": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-0.4.6.tgz", - "integrity": "sha512-/Vj85/kBvPL+n9ibgX6FicLE8VjidC1BhlX67PYPBfbBAphzR6i0k0HtU5c2arejfU3uzq8l3SYPCwl1x7z6Ww==", - "dependencies": { - "console-clear": "^1.1.0", - "get-port": "^3.2.0", - "kleur": "^3.0.0", - "local-access": "^1.0.1", - "sade": "^1.4.0", - "sirv": "^0.4.6", - "tinydate": "^1.0.0" - }, - "bin": { - "sirv": "index.js" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/sirv-cli/node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "engines": { - "node": ">=6" - } - }, "node_modules/source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -740,12 +647,13 @@ "node": ">= 8" } }, - "node_modules/svelte-color-picker": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/svelte-color-picker/-/svelte-color-picker-1.0.7.tgz", - "integrity": "sha512-Xu5efoJKPEouO+rSLkbVR/0EI4ewzO2PgtapC7FdvPlYaCykdqm7YvsoTLaTSNdIljoBtHzNaYgtYxc/ThL5+w==", + "node_modules/svelte-awesome-color-picker": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/svelte-awesome-color-picker/-/svelte-awesome-color-picker-2.4.1.tgz", + "integrity": "sha512-IzICGgaMRMgyK4uukm27UdTFfN7s0QN3eoFyIGiXXY8FCPumS9T+vffVG4rNhiuUUP4ga5SoGUE+KXuNj5dsrw==", + "dev": true, "dependencies": { - "sirv-cli": "^0.4.4" + "colord": "^2.9.3" } }, "node_modules/svelte-hmr": { @@ -765,18 +673,10 @@ "resolved": "https://registry.npmjs.org/svelte-icons/-/svelte-icons-2.1.0.tgz", "integrity": "sha512-rHPQjweEc9fGSnvM0/4gA3pDHwyZyYsC5KhttCZRhSMJfLttJST5Uq0B16Czhw+HQ+HbSOk8kLigMlPs7gZtfg==" }, - "node_modules/tinydate": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/tinydate/-/tinydate-1.3.0.tgz", - "integrity": "sha512-7cR8rLy2QhYHpsBDBVYnnWXm8uRTr38RoZakFSW7Bs7PzfMPNZthuMLkwqZv7MTu8lhQ91cOFYS5a7iFj2oR3w==", - "engines": { - "node": ">=4" - } - }, "node_modules/vite": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.1.1.tgz", - "integrity": "sha512-LM9WWea8vsxhr782r9ntg+bhSFS06FJgCvvB0+8hf8UWtvaiDagKYWXndjfX6kGl74keHJUcpzrQliDXZlF5yg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.1.2.tgz", + "integrity": "sha512-MWDb9Rfy3DI8omDQySbMK93nQqStwbsQWejXRY2EBzEWKmLAXWb1mkI9Yw2IJrc+oCvPCI1Os5xSSIBYY6DEAw==", "dev": true, "dependencies": { "esbuild": "^0.16.14", @@ -998,11 +898,6 @@ "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", "dev": true }, - "@polka/url": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-0.5.0.tgz", - "integrity": "sha512-oZLYFEAzUKyi3SKnXvj32ZCEGH6RDnao7COuCVhDydMS9NrCSVXhM79VaKyP5+Zc33m0QXEd2DN3UkU7OsHcfw==" - }, "@sveltejs/vite-plugin-svelte": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.0.2.tgz", @@ -1017,10 +912,11 @@ "vitefu": "^0.2.3" } }, - "console-clear": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/console-clear/-/console-clear-1.1.1.tgz", - "integrity": "sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==" + "colord": { + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz", + "integrity": "sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==", + "dev": true }, "debug": { "version": "4.3.4", @@ -1080,11 +976,6 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "get-port": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", - "integrity": "sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==" - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1109,11 +1000,6 @@ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", "dev": true }, - "local-access": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/local-access/-/local-access-1.1.0.tgz", - "integrity": "sha512-XfegD5pyTAfb+GY6chk283Ox5z8WexG56OvM06RWLpAc/UHozO8X6xAxEkIitZOtsSMM1Yr3DkHgW5W+onLhCw==" - }, "magic-string": { "version": "0.27.0", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz", @@ -1123,16 +1009,6 @@ "@jridgewell/sourcemap-codec": "^1.4.13" } }, - "mime": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==" - }, - "mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==" - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -1188,44 +1064,6 @@ "fsevents": "~2.3.2" } }, - "sade": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", - "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", - "requires": { - "mri": "^1.1.0" - } - }, - "sirv": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-0.4.6.tgz", - "integrity": "sha512-rYpOXlNbpHiY4nVXxuDf4mXPvKz1reZGap/LkWp9TvcZ84qD/nPBjjH/6GZsgIjVMbOslnY8YYULAyP8jMn1GQ==", - "requires": { - "@polka/url": "^0.5.0", - "mime": "^2.3.1" - } - }, - "sirv-cli": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-0.4.6.tgz", - "integrity": "sha512-/Vj85/kBvPL+n9ibgX6FicLE8VjidC1BhlX67PYPBfbBAphzR6i0k0HtU5c2arejfU3uzq8l3SYPCwl1x7z6Ww==", - "requires": { - "console-clear": "^1.1.0", - "get-port": "^3.2.0", - "kleur": "^3.0.0", - "local-access": "^1.0.1", - "sade": "^1.4.0", - "sirv": "^0.4.6", - "tinydate": "^1.0.0" - }, - "dependencies": { - "kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==" - } - } - }, "source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -1244,12 +1082,13 @@ "integrity": "sha512-S+87/P0Ve67HxKkEV23iCdAh/SX1xiSfjF1HOglno/YTbSTW7RniICMCofWGdJJbdjw3S+0PfFb1JtGfTXE0oQ==", "dev": true }, - "svelte-color-picker": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/svelte-color-picker/-/svelte-color-picker-1.0.7.tgz", - "integrity": "sha512-Xu5efoJKPEouO+rSLkbVR/0EI4ewzO2PgtapC7FdvPlYaCykdqm7YvsoTLaTSNdIljoBtHzNaYgtYxc/ThL5+w==", + "svelte-awesome-color-picker": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/svelte-awesome-color-picker/-/svelte-awesome-color-picker-2.4.1.tgz", + "integrity": "sha512-IzICGgaMRMgyK4uukm27UdTFfN7s0QN3eoFyIGiXXY8FCPumS9T+vffVG4rNhiuUUP4ga5SoGUE+KXuNj5dsrw==", + "dev": true, "requires": { - "sirv-cli": "^0.4.4" + "colord": "^2.9.3" } }, "svelte-hmr": { @@ -1264,15 +1103,10 @@ "resolved": "https://registry.npmjs.org/svelte-icons/-/svelte-icons-2.1.0.tgz", "integrity": "sha512-rHPQjweEc9fGSnvM0/4gA3pDHwyZyYsC5KhttCZRhSMJfLttJST5Uq0B16Czhw+HQ+HbSOk8kLigMlPs7gZtfg==" }, - "tinydate": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/tinydate/-/tinydate-1.3.0.tgz", - "integrity": "sha512-7cR8rLy2QhYHpsBDBVYnnWXm8uRTr38RoZakFSW7Bs7PzfMPNZthuMLkwqZv7MTu8lhQ91cOFYS5a7iFj2oR3w==" - }, "vite": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.1.1.tgz", - "integrity": "sha512-LM9WWea8vsxhr782r9ntg+bhSFS06FJgCvvB0+8hf8UWtvaiDagKYWXndjfX6kGl74keHJUcpzrQliDXZlF5yg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.1.2.tgz", + "integrity": "sha512-MWDb9Rfy3DI8omDQySbMK93nQqStwbsQWejXRY2EBzEWKmLAXWb1mkI9Yw2IJrc+oCvPCI1Os5xSSIBYY6DEAw==", "dev": true, "requires": { "esbuild": "^0.16.14", diff --git a/frontend/package.json b/frontend/package.json index 2855c12..44d7a94 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,10 +11,10 @@ "devDependencies": { "@sveltejs/vite-plugin-svelte": "^2.0.2", "svelte": "^3.55.1", - "vite": "^4.1.1" + "svelte-awesome-color-picker": "^2.4.1", + "vite": "^4.1.2" }, "dependencies": { - "svelte-color-picker": "^1.0.7", "svelte-icons": "^2.1.0" } } diff --git a/frontend/package.json.md5 b/frontend/package.json.md5 index 6271b11..51415fd 100755 --- a/frontend/package.json.md5 +++ b/frontend/package.json.md5 @@ -1 +1 @@ -e49f101dfddc3e941865472ae04a1614 \ No newline at end of file +e4cb4f5d19466c19874dafb9187e8509 \ No newline at end of file diff --git a/frontend/src/components/Env.svelte b/frontend/src/components/Env.svelte index ad47b68..343592b 100644 --- a/frontend/src/components/Env.svelte +++ b/frontend/src/components/Env.svelte @@ -14,22 +14,74 @@ }); function deleteCell(kv) { - delete $config.configuration.env[kv[0]]; + delete $config.env[kv[0]]; + $config = $config; + saveConfig(); } function saveCell(kv, e) { - $config.configuration.env[kv[0]] = e.detail.value; + $config.env[kv[0]] = e.detail.value; + $config = $config; + saveConfig(); } - function addKV(e) { - $config.configuration.env[KVname] = KVvalue; + async function saveConfig() { + if ($config !== null) { + // + // Save the important by cyclic structures. + // + let cpyOS = $config.OS; + let cpyExt = $config.extensions; + let cpyCmd = $config.commands; + + // + // Null them before trying to make a copy. + // + $config.OS = null; + $config.commands = null; + $config.extensions = null; + + // + // Make a copy. + // + let svConfig = JSON.parse(JSON.stringify($config)); + + // + // Restore the structures. + // + $config.OS = cpyOS; + $config.commands = cpyCmd; + $config.extensions = cpyExt; + + // + // Save the configuration. + // + const cfgFile = await $config.OS.appendPath( + $config.configDir, + "config.json" + ); + await $config.OS.writeFile(cfgFile, JSON.stringify(svConfig)); + } + } + + function addKV() { + $config.env[KVname] = KVvalue; addNew = false; + setFocus(true); KVname = ""; KVvalue = ""; + $config = $config; + saveConfig(); + } + + function setFocus(flag) { + dispatch("setKeyProcess", { + blur: flag, + }); } -{#if $config !== null && typeof $config.configuration.env !== "undefined"} +{#if $config !== null && typeof $config.env !== "undefined"}
- + { + setFocus(false); + }} + /> | { + setFocus(false); + }} + on:mouseleave={addKV} /> | diff --git a/frontend/src/components/EnvTableRow.svelte b/frontend/src/components/EnvTableRow.svelte index 8045c1d..5f1a486 100644 --- a/frontend/src/components/EnvTableRow.svelte +++ b/frontend/src/components/EnvTableRow.svelte @@ -17,6 +17,7 @@ function saveInput() { value = inputValue; editValue = false; + setFocus(true); dispatch("save", { value: inputValue, }); @@ -25,6 +26,12 @@ function deleteCell() { dispatch("delete", {}); } + + function setFocus(flag) { + dispatch("setKeyProcess", { + blur: flag, + }); + }
{name} | {#if editValue} - + { + setFocus(false); + }} + on:mouseleave={saveInput} + /> {:else}{value} | {/if} diff --git a/frontend/src/components/ExtensionPrefs.svelte b/frontend/src/components/ExtensionPrefs.svelte index dee96bb..0653ed3 100644 --- a/frontend/src/components/ExtensionPrefs.svelte +++ b/frontend/src/components/ExtensionPrefs.svelte @@ -338,7 +338,6 @@ return({{extName}}); on:mouseover={() => { setFocus(false); }} - on:focus={() => {}} on:mouseleave={() => { setFocus(true); }} diff --git a/frontend/src/components/FileManager.svelte b/frontend/src/components/FileManager.svelte index 1ed4d28..a4f3333 100644 --- a/frontend/src/components/FileManager.svelte +++ b/frontend/src/components/FileManager.svelte @@ -68,6 +68,7 @@ let selRegExpHist = null; onMount(async () => { + console.log("Initialize everything: ", commands); // // Initialize all the stores with minimal settings. // @@ -253,20 +254,19 @@ // // They don't have this file setup. TODO: Set it up or not? // + userEditor = null; } } // // Set the configuration store. // - $config = { - configDir: configDir, - OS: OS, - configuration: $config, - commands: commands, - extensions: extensions, - userEditor: userEditor, - }; + $config.configDir = configDir; + $config.OS = OS; + $config.commands = commands; + $config.extensions = extensions; + $config.userEditor = userEditor; + console.log("Setting the config: ", $config, commands); OS.setConfig($config); extensions.setConfig($config); @@ -279,10 +279,10 @@ // Setup emmiters from the go code. // var commandParse = RegExp("^([^(]*)\\(([^)]*)\\)"); - window.runtime.EventsOn("runCommands", (commands) => { - if (typeof commands === "string" && commands.length > 0) { - for (var i = 0; i < commands.length; i++) { - var parts = commands[i].match(commandParse); + window.runtime.EventsOn("runCommands", (cmds) => { + if (typeof cmds === "string" && cmds.length > 0) { + for (var i = 0; i < cmds.length; i++) { + var parts = cmds[i].match(commandParse); if (parts[2][0] == "'") { parts[2] = parts[2].slice(1, -1); } @@ -290,10 +290,10 @@ } } }); - var commands = await App.GetCommandLineCommands(); - if (commands !== null) { - for (var i = 0; i < commands.length; i++) { - var parts = commands[i].match(commandParse); + var cmds = await App.GetCommandLineCommands(); + if (cmds !== null) { + for (var i = 0; i < cmds.length; i++) { + var parts = cmds[i].match(commandParse); if (parts[2][0] == "'") { parts[2] = parts[2].slice(1, -1); } @@ -316,6 +316,8 @@ // $dirHistory.loadHistory(); + window.config = $config; // debugging + // // return a command to unsubscribe from everything. // @@ -2949,6 +2951,10 @@ createDefaultVisualMap(keyMapDir); createDefaultInsertMap(keyMapDir); } + + async function getOS() { + return OStype; + }