editor: Delete unused `optModFunc` argument

pull/4513/head
Richard Hansen 2020-11-22 19:57:38 -05:00 committed by John McLear
parent d0114d4ac2
commit ed7ba64635
1 changed files with 2 additions and 9 deletions

View File

@ -928,7 +928,7 @@ function Ace2Inner() {
} }
function recolorLinesInRange(startChar, endChar, isTimeUp, optModFunc) { function recolorLinesInRange(startChar, endChar, isTimeUp) {
if (endChar <= startChar) return; if (endChar <= startChar) return;
if (startChar < 0 || startChar >= rep.lines.totalWidth()) return; if (startChar < 0 || startChar >= rep.lines.totalWidth()) return;
let lineEntry = rep.lines.atOffset(startChar); // rounds down to line boundary 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, // tokenFunc function; accesses current value of lineEntry and curDocChar,
// also mutates curDocChar // also mutates curDocChar
let curDocChar; let curDocChar;
let tokenFunc = function (tokenText, tokenClass) { const tokenFunc = function (tokenText, tokenClass) {
lineEntry.domInfo.appendSpan(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()) { while (lineEntry && lineStart < endChar && !isTimeUp()) {
const lineEnd = lineStart + lineEntry.width; const lineEnd = lineStart + lineEntry.width;