From ed7ba64635f6392c70f3279ec6219593b9d994e2 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sun, 22 Nov 2020 19:57:38 -0500 Subject: [PATCH] editor: Delete unused `optModFunc` argument --- src/static/js/ace2_inner.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index bd1227939..890302afc 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -928,7 +928,7 @@ function Ace2Inner() { } - function recolorLinesInRange(startChar, endChar, isTimeUp, optModFunc) { + function recolorLinesInRange(startChar, endChar, isTimeUp) { if (endChar <= startChar) return; if (startChar < 0 || startChar >= rep.lines.totalWidth()) return; let lineEntry = rep.lines.atOffset(startChar); // rounds down to line boundary @@ -942,16 +942,9 @@ function Ace2Inner() { // tokenFunc function; accesses current value of lineEntry and curDocChar, // also mutates curDocChar let curDocChar; - let tokenFunc = function (tokenText, tokenClass) { + const tokenFunc = function (tokenText, tokenClass) { lineEntry.domInfo.appendSpan(tokenText, tokenClass); }; - if (optModFunc) { - const f = tokenFunc; - tokenFunc = function (tokenText, tokenClass) { - optModFunc(tokenText, tokenClass, f, curDocChar); - curDocChar += tokenText.length; - }; - } while (lineEntry && lineStart < endChar && !isTimeUp()) { const lineEnd = lineStart + lineEntry.width;