Browse Source

Suppressed highlighting errors

n1474335 5 năm trước cách đây
mục cha
commit
f864a5f31e
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      src/core/Chef.mjs

+ 6 - 1
src/core/Chef.mjs

@@ -146,7 +146,12 @@ class Chef {
             const func = direction === "forward" ? highlights[i].f : highlights[i].b;
 
             if (typeof func == "function") {
-                pos = func(pos, highlights[i].args);
+                try {
+                    pos = func(pos, highlights[i].args);
+                } catch (err) {
+                    // Throw away highlighting errors
+                    pos = [];
+                }
             }
         }