Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Clear/Add coverage to applicable files in visible editors rather than…
Browse files Browse the repository at this point in the history
… single editor #1343
  • Loading branch information
ramya-rao-a committed Nov 17, 2017
1 parent d20b28e commit cded61c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/goCover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,17 @@ function applyCoverage(remove: boolean = false) {
Object.keys(coverageFiles).forEach(filename => {
let file = coverageFiles[filename];
// Highlight lines in current editor.
let editor = vscode.window.visibleTextEditors.find((value, index, obj) => {
vscode.window.visibleTextEditors.forEach((value, index, obj) => {
let found = value.document.fileName.endsWith(filename);
// Check for file again if outside the $GOPATH.
if (!found && filename.startsWith('_')) {
found = value.document.fileName.endsWith(filename.slice(1));
}
if (found) {
highlightCoverage(value, file, remove);
}
return found;
});
if (editor) {
highlightCoverage(editor, file, remove);
}
});
}

Expand Down

0 comments on commit cded61c

Please sign in to comment.