ace2_inner: Simplify iteration over line number divs

pull/5153/head
Richard Hansen 2021-08-14 22:15:40 -04:00
parent b238d9610a
commit 3237f8d123
1 changed files with 4 additions and 9 deletions

View File

@ -3603,15 +3603,10 @@ function Ace2Inner(editorInfo, cssManagers) {
}
}
let sidebarLine = sideDivInner.firstChild;
currentLine = 0;
while (sidebarLine && currentLine <= sideDivInner.children.length) {
if (lineOffsets[currentLine] != null) {
sidebarLine.style.height = `${lineOffsets[currentLine]}px`;
sidebarLine.style.lineHeight = `${lineHeights[currentLine]}px`;
}
sidebarLine = sidebarLine.nextSibling;
currentLine++;
for (const [i, sideDivLine] of Array.prototype.entries.call(sideDivInner.children)) {
if (lineOffsets[i] == null) continue;
sideDivLine.style.height = `${lineOffsets[i]}px`;
sideDivLine.style.lineHeight = `${lineHeights[i]}px`;
}
};