From bf10e70f2e86efb1c9acf9f509fe73abcc91d6d6 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sun, 15 Aug 2021 00:35:23 -0400 Subject: [PATCH] ace2_inner: Delete unnecessary `currentLine` variable --- src/static/js/ace2_inner.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 415bcae64..8f00f6bb0 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -3543,14 +3543,13 @@ function Ace2Inner(editorInfo, cssManagers) { const defaultLineHeight = parseInt(innerdocbodyStyles['line-height']); let docLine = document.body.firstElementChild; - let currentLine = 0; let h = null; // First loop to calculate the heights from doc body while (docLine) { const nextDocLine = docLine.nextElementSibling; if (nextDocLine) { - if (currentLine === 0) { + if (lineOffsets.length === 0) { // It's the first line. For line number alignment purposes, its // height is taken to be the top offset of the next line. If we // didn't do this special case, we would miss out on any top margin @@ -3582,7 +3581,6 @@ function Ace2Inner(editorInfo, cssManagers) { lineHeights.push(defaultLineHeight); } docLine = nextDocLine; - currentLine++; } let newNumLines = rep.lines.length();