|
1 | 1 | import type { Command, Selection } from 'vscode';
|
2 | 2 | import { MarkdownString, TreeItem, TreeItemCollapsibleState, Uri } from 'vscode';
|
3 |
| -import type { DiffWithPreviousCommandArgs } from '../../commands'; |
| 3 | +import type { OpenFileAtRevisionCommandArgs } from '../../commands'; |
4 | 4 | import { Commands, Schemes } from '../../constants';
|
5 | 5 | import { StatusFileFormatter } from '../../git/formatters/statusFormatter';
|
6 | 6 | import { GitUri } from '../../git/gitUri';
|
@@ -161,26 +161,14 @@ export class CommitFileNode<
|
161 | 161 | }
|
162 | 162 |
|
163 | 163 | override getCommand(): Command | undefined {
|
164 |
| - let line; |
165 |
| - if (this.commit.lines.length) { |
166 |
| - line = this.commit.lines[0].line - 1; |
167 |
| - } else { |
168 |
| - line = this._options.selection?.active.line ?? 0; |
169 |
| - } |
170 |
| - |
171 |
| - const commandArgs: DiffWithPreviousCommandArgs = { |
172 |
| - commit: this.commit, |
173 |
| - uri: GitUri.fromFile(this.file, this.commit.repoPath), |
174 |
| - line: line, |
175 |
| - showOptions: { |
176 |
| - preserveFocus: true, |
177 |
| - preview: true, |
178 |
| - }, |
| 164 | + const commandArgs: OpenFileAtRevisionCommandArgs = { |
| 165 | + revisionUri: GitUri.fromFile(this.file, this.uri.repoPath!, this.ref.ref), |
179 | 166 | };
|
| 167 | + |
180 | 168 | return {
|
181 |
| - title: 'Open Changes with Previous Revision', |
182 |
| - command: Commands.DiffWithPrevious, |
183 |
| - arguments: [undefined, commandArgs], |
| 169 | + title: 'Open File', |
| 170 | + command: Commands.OpenFileAtRevision, |
| 171 | + arguments: [commandArgs], |
184 | 172 | };
|
185 | 173 | }
|
186 | 174 | }
|
0 commit comments