From a9bb149bfa43cadeaaaae8a315eb48621fd5b03b Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Fri, 1 Jun 2018 09:57:40 +0100 Subject: [PATCH] Try to let multiple autocommands run per event --- src/excmds.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/excmds.ts b/src/excmds.ts index a7279b4b..22abd85f 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -1175,9 +1175,8 @@ loadaucmds("DocStart") export async function loadaucmds(cmdType: "DocStart" | "TabEnter" | "TabLeft") { let aucmds = await config.getAsync("autocmds", cmdType) const ausites = Object.keys(aucmds) - // yes, this is lazy - const aukey = ausites.find(e => window.document.location.href.search(e) >= 0) - if (aukey !== undefined) { + const aukeyarr = ausites.filter(e => window.document.location.href.search(e) >= 0) + for (let aukey of aukeyarr) { Messaging.message("commandline_background", "recvExStr", [aucmds[aukey]]) } }