From 133c155ae44543c21e697e1b652761bd134aa883 Mon Sep 17 00:00:00 2001 From: mattpass Date: Sun, 25 Jul 2021 15:33:54 +0100 Subject: [PATCH] Only 1 rBlock per top value --- assets/js/icecoder.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/js/icecoder.js b/assets/js/icecoder.js index f4bd48f..23722bf 100644 --- a/assets/js/icecoder.js +++ b/assets/js/icecoder.js @@ -3073,7 +3073,7 @@ var ICEcoder = { }, findInCMContent: function(thisCM, rExp, selectNext) { - let avgBlockH, addPadding, rBlocks, haveMatch, rExpMatch0String, rBlockTop; + let avgBlockH, addPadding, rBlocks, haveMatch, rExpMatch0String, rBlockTop, lastRBlockTop; // Start new iterators for line & last line let i = 0; @@ -3098,6 +3098,7 @@ var ICEcoder = { rBlocks = ""; rExpMatch0String = ""; + lastRBlockTop = 0; thisCM.eachLine(function(line) { i++; @@ -3130,8 +3131,9 @@ var ICEcoder = { results.push([i, match.index]); } // If we have a match, add the DOM elem into our rBlocks string - if (true === haveMatch) { + if (true === haveMatch && rBlockTop !== lastRBlockTop) { rBlocks += '
'; + lastRBlockTop = rBlockTop; } });