diff --git a/lib/ace/search_highlight.js b/lib/ace/search_highlight.js index 11defd9cdc1..58da750ce95 100644 --- a/lib/ace/search_highlight.js +++ b/lib/ace/search_highlight.js @@ -56,6 +56,7 @@ var SearchHighlight = function(regExp, clazz, type) { if (!this.regExp) return; var start = config.firstRow, end = config.lastRow; + var renderedMarkerRanges = {}; for (var i = start; i <= end; i++) { var ranges = this.cache[i]; @@ -70,8 +71,13 @@ var SearchHighlight = function(regExp, clazz, type) { } for (var j = ranges.length; j --; ) { + var rangeToAddMarkerTo = ranges[j].toScreenRange(session); + var rangeAsString = rangeToAddMarkerTo.toString(); + if (renderedMarkerRanges[rangeAsString]) continue; + + renderedMarkerRanges[rangeAsString] = true; markerLayer.drawSingleLineMarker( - html, ranges[j].toScreenRange(session), this.clazz, config); + html, rangeToAddMarkerTo, this.clazz, config); } } };