From ca2e008e7b658d312c92c4f57f6d7e69e4e0db60 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sun, 15 Aug 2021 00:37:03 -0400 Subject: [PATCH] ace2_inner: Move variable declarations to appropriate scope --- src/static/js/ace2_inner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 8f00f6bb0..1487349b1 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -2596,7 +2596,6 @@ function Ace2Inner(editorInfo, cssManagers) { // tab keypress, adding keyCode == 9 to this doesn't help as the event is fired twice return; } - let specialHandled = false; const isTypeForSpecialKey = browser.safari || browser.chrome || browser.firefox ? type === 'keydown' : type === 'keypress'; @@ -2619,6 +2618,7 @@ function Ace2Inner(editorInfo, cssManagers) { } else if (type === 'keydown') { outsideKeyDown(evt); } + let specialHandled = false; if (!stopped) { const specialHandledInHook = hooks.callAll('aceKeyEvent', { callstack: currentCallStack, @@ -3543,10 +3543,10 @@ function Ace2Inner(editorInfo, cssManagers) { const defaultLineHeight = parseInt(innerdocbodyStyles['line-height']); let docLine = document.body.firstElementChild; - let h = null; // First loop to calculate the heights from doc body while (docLine) { + let h; const nextDocLine = docLine.nextElementSibling; if (nextDocLine) { if (lineOffsets.length === 0) {