From e8f11d9889c57a26ca71aa3d7b3bdd8d7f67c845 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sat, 12 Sep 2020 02:02:34 -0400 Subject: [PATCH] Fixes back button on search command --- src/commands/git/search.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/commands/git/search.ts b/src/commands/git/search.ts index f4a1e4d..98da743 100644 --- a/src/commands/git/search.ts +++ b/src/commands/git/search.ts @@ -140,6 +140,7 @@ export class SearchGitCommand extends QuickCommand { // If we skipped the previous step, make sure we back up past it if (skippedStepOne) { skippedStepOne = false; + state.counter--; } state.pattern = undefined; @@ -341,7 +342,11 @@ export class SearchGitCommand extends QuickCommand { }, }); const selection: StepSelection = yield step; - if (!QuickCommand.canPickStepContinue(step, state, selection)) return StepResult.Break; + if (!QuickCommand.canPickStepContinue(step, state, selection)) { + // Since we simulated a step above, we need to remove it here + state.counter--; + return StepResult.Break; + } // Since we simulated a step above, we need to remove it here state.counter--;