ace2_inner: Add line number divs directly, not via fragment

There's no layout thrashing so the fragment doesn't provide any
benefit.
This commit is contained in:
Richard Hansen 2021-08-14 20:51:18 -04:00
parent e1a024847c
commit 27363bf729

View file

@ -3604,8 +3604,6 @@ function Ace2Inner(editorInfo, cssManagers) {
}
if (newNumLines !== lineNumbersShown) {
const fragment = outerDoc.createDocumentFragment();
// Create missing line and apply height
while (lineNumbersShown < newNumLines) {
lineNumbersShown++;
@ -3615,10 +3613,9 @@ function Ace2Inner(editorInfo, cssManagers) {
div.style.lineHeight = `${lineHeights[currentLine]}px`;
}
$(div).append($(`<span class='line-number'>${String(lineNumbersShown)}</span>`));
fragment.appendChild(div);
sideDivInner.appendChild(div);
currentLine++;
}
sideDivInner.appendChild(fragment);
// Remove extra lines
while (lineNumbersShown > newNumLines) {