From 7dfbc19f54f13b2157e490ba616c8ca9131a2776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Csord=C3=A1s?= Date: Tue, 3 Apr 2018 14:09:06 +0200 Subject: [PATCH] Highlight last bug path message fix The last bug path message is highlighted in red color even if the bug path continues later on in another file. This commit highlights last bug path message if it is absolutely last. --- www/scripts/codecheckerviewer/BugViewer.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/www/scripts/codecheckerviewer/BugViewer.js b/www/scripts/codecheckerviewer/BugViewer.js index 20e7425eb3..f24110a97a 100644 --- a/www/scripts/codecheckerviewer/BugViewer.js +++ b/www/scripts/codecheckerviewer/BugViewer.js @@ -232,18 +232,19 @@ function (declare, domClass, dom, style, fx, Toggler, keys, on, query, Memory, CC_SERVICE.getReportDetails(this.reportData.reportId, function (reportDetails) { var points = reportDetails.executionPath.filter(filterFunction); - reportDetails.pathEvents.map(function (evt, index) { + var pathEvents = reportDetails.pathEvents; + pathEvents.map(function (evt, index) { evt.bugEventNumber = index + 1; }); - var bubbles = reportDetails.pathEvents.filter(filterFunction); + var bubbles = pathEvents.filter(filterFunction); // This is needed because CodeChecker gives different positions. points.forEach(function (point) { --point.startCol; }); points.forEach(function (bubble) { --bubble.startCol; }); if (bubblesNeeded) { - that.addBubbles(bubbles); + that.addBubbles(bubbles, pathEvents.length); that.addOtherFileBubbles(reportDetails.executionPath); } @@ -252,12 +253,12 @@ function (declare, domClass, dom, style, fx, Toggler, keys, on, query, Memory, }); }, - addBubbles : function (bubbles) { + addBubbles : function (bubbles, numOfPathEvents) { var that = this; that.codeMirror.operation(function () { bubbles.forEach(function (bubble, i) { - var isResult = i === bubbles.length - 1; + var isResult = bubble.bugEventNumber === numOfPathEvents; var left = that.codeMirror.defaultCharWidth() * bubble.startCol + 'px';