From 4781ac1d919f86a09df4e7d07f7271c0474d8c12 Mon Sep 17 00:00:00 2001 From: Dranaxel Date: Fri, 12 Jun 2020 19:26:25 +0200 Subject: [PATCH 1/2] Refactorised source_quiet in src/excmd.ts --- src/excmds.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/excmds.ts b/src/excmds.ts index 483b6fa7..54fe3dda 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -781,17 +781,9 @@ export async function source(...args: string[]) { * Same as [[source]] but suppresses all errors */ //#background -export async function source_quiet(...args: string[]) { +export async function source_quiet(args: string[]) { try { - if (args[0] === "--url") { - let url = args[1] - if (!url || url === "%") url = window.location.href - if (!(url.startsWith("http://") || url.startsWith("https://"))) url = "http://" + url - await rc.sourceFromUrl(url) - } else { - const file = args.join(" ") || undefined - if (await Native.nativegate("0.1.3", false)) rc.source(file) - } + source(...args) } catch (e) { logger.info("Automatic loading of RC file failed.") } From e88e154d948d4df409517ce3c07c317e584aac66 Mon Sep 17 00:00:00 2001 From: Dranaxel Date: Fri, 12 Jun 2020 20:30:53 +0200 Subject: [PATCH 2/2] awaiting the async function --- src/excmds.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/excmds.ts b/src/excmds.ts index 54fe3dda..d930fc60 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -783,7 +783,7 @@ export async function source(...args: string[]) { //#background export async function source_quiet(args: string[]) { try { - source(...args) + await source(...args) } catch (e) { logger.info("Automatic loading of RC file failed.") }