瀏覽代碼

Avoids pinning commit details by default

main
Eric Amodio 2 年之前
父節點
當前提交
2954a5e75f
共有 6 個檔案被更改,包括 11 行新增10 行删除
  1. +5
    -4
      src/commands/showCommitsInView.ts
  2. +2
    -2
      src/plus/webviews/graph/graphWebview.ts
  3. +1
    -1
      src/plus/webviews/timeline/timelineWebview.ts
  4. +1
    -1
      src/plus/webviews/timeline/timelineWebviewView.ts
  5. +1
    -1
      src/webviews/commitDetails/commitDetailsWebviewView.ts
  6. +1
    -1
      src/webviews/rebase/rebaseEditor.ts

+ 5
- 4
src/commands/showCommitsInView.ts 查看文件

@ -1,8 +1,9 @@
import type { TextEditor, Uri } from 'vscode';
import { executeGitCommand } from '../commands/gitCommands.actions';
import { executeGitCommand, GitActions } from '../commands/gitCommands.actions';
import { Commands } from '../constants';
import type { Container } from '../container';
import { GitUri } from '../git/gitUri';
import { GitReference } from '../git/models/reference';
import { createSearchQueryForCommits } from '../git/search';
import { Logger } from '../logger';
import { showFileNotUnderSourceControlWarningMessage, showGenericErrorMessage } from '../messages';
@ -79,9 +80,9 @@ export class ShowCommitsInViewCommand extends ActiveEditorCommand {
}
if (args.refs.length === 1) {
return this.container.commitDetailsView.show({
commit: { ref: args.refs[0], refType: 'revision', repoPath: args.repoPath!, name: '' },
});
return GitActions.Commit.showDetailsView(
GitReference.create(args.refs[0], args.repoPath!, { refType: 'revision' }),
);
}
return executeGitCommand({

+ 2
- 2
src/plus/webviews/graph/graphWebview.ts 查看文件

@ -435,7 +435,7 @@ export class GraphWebview extends WebviewBase {
if (this.selection != null) {
void GitActions.Commit.showDetailsView(this.selection[0], {
pin: true,
pin: false,
preserveFocus: true,
preserveVisibility: this._showDetailsView === false,
});
@ -879,7 +879,7 @@ export class GraphWebview extends WebviewBase {
if (commits == null) return;
void GitActions.Commit.showDetailsView(commits[0], {
pin: true,
pin: false,
preserveFocus: true,
preserveVisibility: this._firstSelection
? this._showDetailsView === false

+ 1
- 1
src/plus/webviews/timeline/timelineWebview.ts 查看文件

@ -148,7 +148,7 @@ export class TimelineWebview extends WebviewBase {
const commit = await repository.getCommit(params.data.id);
if (commit == null) return;
void GitActions.Commit.showDetailsView(commit, { pin: true, preserveFocus: true });
void GitActions.Commit.showDetailsView(commit, { pin: false, preserveFocus: true });
});
break;

+ 1
- 1
src/plus/webviews/timeline/timelineWebviewView.ts 查看文件

@ -126,7 +126,7 @@ export class TimelineWebviewView extends WebviewViewBase {
const commit = await repository.getCommit(params.data.id);
if (commit == null) return;
void GitActions.Commit.showDetailsView(commit, { pin: true, preserveFocus: true });
void GitActions.Commit.showDetailsView(commit, { pin: false, preserveFocus: true });
});
break;

+ 1
- 1
src/webviews/commitDetails/commitDetailsWebviewView.ts 查看文件

@ -128,7 +128,7 @@ export class CommitDetailsWebviewView extends WebviewViewBase
commit = await this.container.git.getCommit(commit.repoPath, commit.ref);
}
}
this.updateCommit(commit, { pinned: pin ?? true });
this.updateCommit(commit, { pinned: pin ?? false });
}
}

+ 1
- 1
src/webviews/rebase/rebaseEditor.ts 查看文件

@ -447,7 +447,7 @@ export class RebaseEditorProvider implements CustomTextEditorProvider, Disposabl
const showDetailsView = configuration.get('rebaseEditor.showDetailsView');
void GitActions.Commit.showDetailsView(commit, {
pin: true,
pin: false,
preserveFocus: true,
preserveVisibility: context.firstSelection ? showDetailsView === false : showDetailsView !== 'selection',
});

Loading…
取消
儲存