aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/source-viewer/viewer.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/source-viewer/viewer.js')
-rw-r--r--server/sonar-web/src/main/js/source-viewer/viewer.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/source-viewer/viewer.js b/server/sonar-web/src/main/js/source-viewer/viewer.js
index 72f197f7008..66600022fa2 100644
--- a/server/sonar-web/src/main/js/source-viewer/viewer.js
+++ b/server/sonar-web/src/main/js/source-viewer/viewer.js
@@ -434,10 +434,16 @@ define([
blocks = this.model.get('duplications')[index - 1].blocks,
inRemovedComponent = _.some(blocks, function (b) {
return b._ref == null;
- });
+ }),
+ foundOne = false;
blocks = _.filter(blocks, function (b) {
- var outOfBounds = b.from > line || b.from + b.size < line;
- return (b._ref != null) && ((b._ref !== '1') || (b._ref === '1' && outOfBounds));
+ var outOfBounds = b.from > line || b.from + b.size < line,
+ currentFile = b._ref === '1',
+ isOk = (b._ref != null) && (!currentFile || (currentFile && (outOfBounds || foundOne)));
+ if (b._ref === '1' && !outOfBounds) {
+ foundOne = true;
+ }
+ return isOk;
});
var popup = new DuplicationPopupView({
triggerEl: $(e.currentTarget),