From 8af7841de331a8e65fb8d5968f35e210ac508e6e Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Tue, 12 Jan 2016 07:47:02 -0600 Subject: [PATCH] Fixed syncscroll might have duplicated and wrong scrollMap if editor not shown --- public/js/syncscroll.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/syncscroll.js b/public/js/syncscroll.js index faa6a6a..c3793a8 100644 --- a/public/js/syncscroll.js +++ b/public/js/syncscroll.js @@ -218,7 +218,7 @@ function buildMapInner(syncBack) { return; } t = _lineHeightMap[t]; - if (t !== 0) { + if (t !== 0 && t !== nonEmptyList[nonEmptyList.length - 1]) { nonEmptyList.push(t); } _scrollMap[t] = Math.round($el.offset().top + offset - 10);