From 2ad0de95edbf8b7d92f3462acb331ce99a445208 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Fri, 18 Nov 2022 15:47:46 -0500 Subject: [PATCH] Fixes #2354 avoids disabling quickpick VS Code made a change (or a new bug) that focuses the quickpick container rather than the input if the quick pick is disabled when it is shown --- CHANGELOG.md | 4 ++++ src/commands/git/pull.ts | 2 -- src/commands/git/push.ts | 2 -- src/commands/gitCommands.ts | 2 -- src/commands/quickCommand.steps.ts | 4 ---- src/quickpicks/commitPicker.ts | 6 ------ src/quickpicks/referencePicker.ts | 2 -- 7 files changed, 4 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c04a69b..d39dcb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ## [Unreleased] +### Fixed + +- Fixes [#2354](https://github.com/gitkraken/vscode-gitlens/issues/2354) - 'GitLens: Compare working three with...' Not able to select branch using keyboard + ## [13.1.0] - 2022-11-17 ### Added diff --git a/src/commands/git/pull.ts b/src/commands/git/pull.ts index 0ad0d6b..1b7494b 100644 --- a/src/commands/git/pull.ts +++ b/src/commands/git/pull.ts @@ -232,14 +232,12 @@ export class PullGitCommand extends QuickCommand { }`; quickpick.busy = true; - quickpick.enabled = false; try { await repo.fetch({ progress: true }); // Signal that the step should be retried return true; } finally { quickpick.busy = false; - quickpick.enabled = true; } }, }, diff --git a/src/commands/git/push.ts b/src/commands/git/push.ts index 8eb4b08..7aa5fb9 100644 --- a/src/commands/git/push.ts +++ b/src/commands/git/push.ts @@ -396,14 +396,12 @@ export class PushGitCommand extends QuickCommand { }`; quickpick.busy = true; - quickpick.enabled = false; try { await repo.fetch({ progress: true }); // Signal that the step should be retried return true; } finally { quickpick.busy = false; - quickpick.enabled = true; } }; } diff --git a/src/commands/gitCommands.ts b/src/commands/gitCommands.ts index 819c9a0..7c02b7c 100644 --- a/src/commands/gitCommands.ts +++ b/src/commands/gitCommands.ts @@ -457,7 +457,6 @@ export class GitCommandsCommand extends Command { if (step.onDidLoadMore == null) return; quickpick.busy = true; - quickpick.enabled = false; try { const items = await step.onDidLoadMore?.(quickpick); @@ -480,7 +479,6 @@ export class GitCommandsCommand extends Command { } } finally { quickpick.busy = false; - quickpick.enabled = true; } } diff --git a/src/commands/quickCommand.steps.ts b/src/commands/quickCommand.steps.ts index 90625e7..edf32ad 100644 --- a/src/commands/quickCommand.steps.ts +++ b/src/commands/quickCommand.steps.ts @@ -714,7 +714,6 @@ export async function* pickBranchOrTagStep< onDidClickButton: async (quickpick, button) => { if (button === showTagsButton) { quickpick.busy = true; - quickpick.enabled = false; try { context.showTags = !context.showTags; @@ -730,7 +729,6 @@ export async function* pickBranchOrTagStep< quickpick.items = branchesAndOrTags; } finally { quickpick.busy = false; - quickpick.enabled = true; } } }, @@ -823,7 +821,6 @@ export async function* pickBranchOrTagStepMultiRepo< onDidClickButton: async (quickpick, button) => { if (button === showTagsButton) { quickpick.busy = true; - quickpick.enabled = false; try { context.showTags = !context.showTags; @@ -845,7 +842,6 @@ export async function* pickBranchOrTagStepMultiRepo< quickpick.items = branchesAndOrTags; } finally { quickpick.busy = false; - quickpick.enabled = true; } } }, diff --git a/src/quickpicks/commitPicker.ts b/src/quickpicks/commitPicker.ts index b0077d3..1fbee7f 100644 --- a/src/quickpicks/commitPicker.ts +++ b/src/quickpicks/commitPicker.ts @@ -35,7 +35,6 @@ export namespace CommitPicker { if (isPromise(log)) { quickpick.busy = true; - quickpick.enabled = false; quickpick.show(); log = await log; @@ -68,7 +67,6 @@ export namespace CommitPicker { async function loadMore() { quickpick.busy = true; - quickpick.enabled = false; try { log = await (await log)?.more?.(configuration.get('advanced.maxListItems')); @@ -92,7 +90,6 @@ export namespace CommitPicker { } } finally { quickpick.busy = false; - quickpick.enabled = true; } } @@ -162,7 +159,6 @@ export namespace CommitPicker { ); quickpick.busy = false; - quickpick.enabled = true; quickpick.show(); }); @@ -208,7 +204,6 @@ export namespace StashPicker { if (isPromise(stash)) { quickpick.busy = true; - quickpick.enabled = false; quickpick.show(); stash = await stash; @@ -296,7 +291,6 @@ export namespace StashPicker { ); quickpick.busy = false; - quickpick.enabled = true; quickpick.show(); }); diff --git a/src/quickpicks/referencePicker.ts b/src/quickpicks/referencePicker.ts index 62c0868..11a3637 100644 --- a/src/quickpicks/referencePicker.ts +++ b/src/quickpicks/referencePicker.ts @@ -89,7 +89,6 @@ export namespace ReferencePicker { } quickpick.busy = true; - quickpick.enabled = false; quickpick.show(); @@ -104,7 +103,6 @@ export namespace ReferencePicker { quickpick.items = await items; quickpick.busy = false; - quickpick.enabled = true; try { let pick = await new Promise(resolve => {