From 5aa318a09b4595eee1da715e10d7fe69cbd1d44b Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 6 Oct 2020 17:37:26 -0400 Subject: [PATCH] Call the aceAttribClasses hook synchronously We could instead await the results of the hook, but then all callers and their callers recursively would have to be converted to async, and that's a huge change. --- src/static/js/linestylefilter.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/static/js/linestylefilter.js b/src/static/js/linestylefilter.js index 85e69b2be..a3cf68433 100644 --- a/src/static/js/linestylefilter.js +++ b/src/static/js/linestylefilter.js @@ -59,11 +59,8 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun { // Plugin Hook to add more Attrib Classes - hooks.aCallAll('aceAttribClasses', linestylefilter.ATTRIB_CLASSES, function(err, ATTRIB_CLASSES){ - if(ATTRIB_CLASSES.length >= 1){ - linestylefilter.ATTRIB_CLASSES = ATTRIB_CLASSES[0]; - } - }); + const results = hooks.callAll('aceAttribClasses', linestylefilter.ATTRIB_CLASSES); + if (results.length >= 1) linestylefilter.ATTRIB_CLASSES = results[0]; if (lineLength == 0) return textAndClassFunc;