Try to let multiple autocommands run per event

This commit is contained in:
Oliver Blanthorn 2018-06-01 09:57:40 +01:00
parent 80607484d0
commit a9bb149bfa
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -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]])
}
}