diff --git a/report-viewer/src/components/fileDisplaying/FilesContainer.vue b/report-viewer/src/components/fileDisplaying/FilesContainer.vue index ba868150f..f3bc3c327 100644 --- a/report-viewer/src/components/fileDisplaying/FilesContainer.vue +++ b/report-viewer/src/components/fileDisplaying/FilesContainer.vue @@ -26,7 +26,9 @@ :highlight-language="highlightLanguage" @match-selected="(match: Match) => $emit('matchSelected', match)" class="mt-1 first:mt-0" - :base-code-matches="baseCodeMatches" + :base-code-matches=" + baseCodeMatches.filter((match) => slash(match.fileName) === file.fileName) + " /> @@ -50,6 +52,7 @@ import { FileSortingOptions } from '@/model/ui/FileSortingOptions' import { store } from '@/stores/store' import type { BaseCodeMatch } from '@/model/BaseCodeReport' import type { Match } from '@/model/Match' +import slash from 'slash' library.add(faCompressAlt) diff --git a/report-viewer/src/model/MatchInSingleFile.ts b/report-viewer/src/model/MatchInSingleFile.ts index 1c62b1cd5..5699be553 100644 --- a/report-viewer/src/model/MatchInSingleFile.ts +++ b/report-viewer/src/model/MatchInSingleFile.ts @@ -56,4 +56,12 @@ export class MatchInSingleFile { return this._match.endInSecond.column } } + + get fileName(): string { + if (this._index === 1) { + return this._match.firstFile + } else { + return this._match.secondFile + } + } }