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--;