Pārlūkot izejas kodu

Opens file/diff to side if graph/rebase is active

main
Eric Amodio pirms 1 gada
vecāks
revīzija
2e2e7d06ec
1 mainītis faili ar 11 papildinājumiem un 4 dzēšanām
  1. +11
    -4
      src/webviews/commitDetails/commitDetailsWebviewView.ts

+ 11
- 4
src/webviews/commitDetails/commitDetailsWebviewView.ts Parādīt failu

@ -1,10 +1,11 @@
import type {
CancellationToken,
ConfigurationChangeEvent,
TextDocumentShowOptions,
TreeViewSelectionChangeEvent,
TreeViewVisibilityChangeEvent,
} from 'vscode';
import { CancellationTokenSource, Disposable, Uri, window } from 'vscode';
import { CancellationTokenSource, Disposable, Uri, ViewColumn, window } from 'vscode';
import { serializeAutolink } from '../../annotations/autolinks';
import type { CopyShaToClipboardCommandArgs } from '../../commands';
import { executeGitCommand, GitActions } from '../../commands/gitCommands.actions';
@ -848,7 +849,7 @@ export class CommitDetailsWebviewView extends WebviewViewBase
void GitActions.Commit.openChangesWithWorking(file.path, commit, {
preserveFocus: true,
preview: true,
...params.showOptions,
...this.getShowOptions(params),
});
}
@ -862,7 +863,7 @@ export class CommitDetailsWebviewView extends WebviewViewBase
void GitActions.Commit.openChanges(file.path, commit, {
preserveFocus: true,
preview: true,
...params.showOptions,
...this.getShowOptions(params),
});
}
@ -876,7 +877,7 @@ export class CommitDetailsWebviewView extends WebviewViewBase
void GitActions.Commit.openFile(file.path, commit, {
preserveFocus: true,
preview: true,
...params.showOptions,
...this.getShowOptions(params),
});
}
@ -888,6 +889,12 @@ export class CommitDetailsWebviewView extends WebviewViewBase
void GitActions.Commit.openFileOnRemote(file.path, commit);
}
private getShowOptions(params: FileActionParams): TextDocumentShowOptions | undefined {
return getContext('gitlens:webview:graph:active') || getContext('gitlens:webview:rebaseEditor:active')
? { ...params.showOptions, viewColumn: ViewColumn.Beside }
: params.showOptions;
}
}
// async function summaryModel(commit: GitCommit): Promise<CommitSummary> {

Notiek ielāde…
Atcelt
Saglabāt