diff --git a/src/commands.ts b/src/commands.ts index 6e6b85d..d8b8740 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -54,7 +54,7 @@ export class DiffWithPreviousCommand extends Command { return this.git.getVersionedFile(uri.path, sha).then(source => { this.git.getVersionedFile(uri.path, compareWithSha).then(compare => { const fileName = basename(uri.path); - return commands.executeCommand(VsCodeCommands.Diff, Uri.file(source), Uri.file(compare), `${fileName} (${sha}) ↔ ${fileName} (${compareWithSha})`); + return commands.executeCommand(VsCodeCommands.Diff, Uri.file(compare), Uri.file(source), `${fileName} (${compareWithSha}) ↔ ${fileName} (${sha})`); }) }); } @@ -68,7 +68,7 @@ export class DiffWithWorkingCommand extends Command { execute(uri?: Uri, sha?: string) { return this.git.getVersionedFile(uri.path, sha).then(compare => { const fileName = basename(uri.path); - return commands.executeCommand(VsCodeCommands.Diff, uri, Uri.file(compare), `${fileName} (index) ↔ ${fileName} (${sha})`); + return commands.executeCommand(VsCodeCommands.Diff, Uri.file(compare), uri, `${fileName} (${sha}) ↔ ${fileName} (index)`); }); } } \ No newline at end of file diff --git a/src/gitBlameCodeLensProvider.ts b/src/gitBlameCodeLensProvider.ts index d7b5997..0f8af0b 100644 --- a/src/gitBlameCodeLensProvider.ts +++ b/src/gitBlameCodeLensProvider.ts @@ -38,7 +38,7 @@ export default class GitBlameCodeLensProvider implements CodeLensProvider { const lenses: CodeLens[] = []; // Add codelens to each "group" of blame lines - const lines = blame.lines.filter(l => l.sha === data.sha); + const lines = blame.lines.filter(l => l.sha === data.sha && l.originalLine >= data.range.start.line && l.originalLine <= data.range.end.line); let lastLine = lines[0].originalLine; lines.forEach(l => { if (l.originalLine !== lastLine + 1) {