Make the aceAttribClasses hook harder to misuse

This commit is contained in:
Richard Hansen 2020-10-06 17:47:03 -04:00 committed by John McLear
parent 5aa318a09b
commit ba6bdf35be
2 changed files with 13 additions and 9 deletions

View file

@ -59,8 +59,9 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun
{
// Plugin Hook to add more Attrib Classes
const results = hooks.callAll('aceAttribClasses', linestylefilter.ATTRIB_CLASSES);
if (results.length >= 1) linestylefilter.ATTRIB_CLASSES = results[0];
for (const attribClasses of hooks.callAll('aceAttribClasses', linestylefilter.ATTRIB_CLASSES)) {
Object.assign(linestylefilter.ATTRIB_CLASSES, attribClasses);
}
if (lineLength == 0) return textAndClassFunc;