mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-08 17:25:52 -05:00
Fixes go back support
This commit is contained in:
@@ -25,7 +25,7 @@ export class ShowCommitSearchCommand extends ActiveEditorCachedCommand {
|
|||||||
prompt: `Please enter a search string`,
|
prompt: `Please enter a search string`,
|
||||||
placeHolder: `search by message, author (use a:<name>), files (use f:<pattern>), or sha (use s:<hash>)`
|
placeHolder: `search by message, author (use a:<name>), files (use f:<pattern>), or sha (use s:<hash>)`
|
||||||
} as InputBoxOptions);
|
} as InputBoxOptions);
|
||||||
if (!search) return undefined;
|
if (search === undefined) return goBackCommand && goBackCommand.execute();
|
||||||
|
|
||||||
if (Git.isSha(search)) {
|
if (Git.isSha(search)) {
|
||||||
searchBy = 'sha';
|
searchBy = 'sha';
|
||||||
@@ -71,15 +71,13 @@ export class ShowCommitSearchCommand extends ActiveEditorCachedCommand {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!goBackCommand) {
|
// Create a command to get back to here
|
||||||
// Create a command to get back to the branch history
|
const currentCommand = new CommandQuickPickItem({
|
||||||
goBackCommand = new CommandQuickPickItem({
|
label: `go back \u21A9`,
|
||||||
label: `go back \u21A9`,
|
description: `\u00a0 \u2014 \u00a0\u00a0 to commit search`
|
||||||
description: `\u00a0 \u2014 \u00a0\u00a0 to commit search`
|
}, Commands.ShowCommitSearch, [gitUri, originalSearch, undefined, goBackCommand]);
|
||||||
}, Commands.ShowCommitSearch, [gitUri, originalSearch]);
|
|
||||||
}
|
|
||||||
|
|
||||||
const pick = await CommitsQuickPick.show(this.git, log, placeHolder, goBackCommand);
|
const pick = await CommitsQuickPick.show(this.git, log, placeHolder, currentCommand);
|
||||||
if (!pick) return undefined;
|
if (!pick) return undefined;
|
||||||
|
|
||||||
if (pick instanceof CommandQuickPickItem) {
|
if (pick instanceof CommandQuickPickItem) {
|
||||||
|
|||||||
Reference in New Issue
Block a user