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.
pull/4406/head
Richard Hansen 2020-10-06 17:37:26 -04:00 committed by John McLear
parent 92d4b8b649
commit 5aa318a09b
1 changed files with 2 additions and 5 deletions

View File

@ -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;