From 76ee2bc85ce7795ed9bd8dc56322dd4ef7cdbf1c Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 18 Dec 2017 18:16:21 -0500 Subject: [PATCH] Fixes unable to go back after show all --- src/commands/showCommitSearch.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/commands/showCommitSearch.ts b/src/commands/showCommitSearch.ts index 7138e60..fd482bd 100644 --- a/src/commands/showCommitSearch.ts +++ b/src/commands/showCommitSearch.ts @@ -119,16 +119,18 @@ export class ShowCommitSearchCommand extends ActiveEditorCachedCommand { if (progressCancellation.token.isCancellationRequested) return undefined; + const goBackCommand = args.goBackCommand || new CommandQuickPickItem({ + label: `go back ${GlyphChars.ArrowBack}`, + description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to commit search` + }, Commands.ShowCommitSearch, [uri, originalArgs]); + const pick = await CommitsQuickPick.show(this.git, log, searchLabel!, progressCancellation, { - goBackCommand: new CommandQuickPickItem({ - label: `go back ${GlyphChars.ArrowBack}`, - description: `${Strings.pad(GlyphChars.Dash, 2, 3)} to commit search` - }, Commands.ShowCommitSearch, [uri, originalArgs]), + goBackCommand: goBackCommand, showAllCommand: log !== undefined && log.truncated ? new CommandQuickPickItem({ label: `$(sync) Show All Commits`, description: `${Strings.pad(GlyphChars.Dash, 2, 3)} this may take a while` - }, Commands.ShowCommitSearch, [uri, { ...args, maxCount: 0 }]) + }, Commands.ShowCommitSearch, [uri, { ...args, maxCount: 0, goBackCommand: goBackCommand }]) : undefined, showInResultsExplorerCommand: log !== undefined ? new ShowCommitsSearchInResultsQuickPickItem(log, searchLabel!)