Skip to content

Commit

Permalink
only display basecode for given file
Browse files Browse the repository at this point in the history
  • Loading branch information
Kr0nox committed Dec 3, 2024
1 parent 862f483 commit 28228b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
"
/>
</VueDraggableNext>
</ScrollableComponent>
Expand All @@ -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)

Expand Down
8 changes: 8 additions & 0 deletions report-viewer/src/model/MatchInSingleFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

0 comments on commit 28228b6

Please sign in to comment.