@@ -3,7 +3,7 @@ import { TreeItem, TreeItemCollapsibleState } from 'vscode';
33import { getRepoPathOrPrompt } from '../../commands' ;
44import { CommandContext , GlyphChars , NamedRef , setCommandContext } from '../../constants' ;
55import { GitService } from '../../git/gitService' ;
6- import { CommandQuickPickItem , ReferencesQuickPick } from '../../quickpicks' ;
6+ import { ReferencesQuickPick } from '../../quickpicks' ;
77import { debug , gate , Iterables , log , Promises } from '../../system' ;
88import { CompareView } from '../compareView' ;
99import { MessageNode } from './common' ;
@@ -135,6 +135,7 @@ export class CompareNode extends ViewNode<CompareView> {
135135 else if ( repoPath !== this . _selectedRef . repoPath ) {
136136 // If we don't have a matching repoPath, then start over
137137 void this . selectForCompare ( repoPath , ref ) ;
138+
138139 return ;
139140 }
140141
@@ -148,7 +149,12 @@ export class CompareNode extends ViewNode<CompareView> {
148149 checkmarks : true
149150 }
150151 ) ;
151- if ( pick === undefined || pick instanceof CommandQuickPickItem ) return ;
152+ if ( pick === undefined ) {
153+ await this . view . show ( ) ;
154+ await this . view . reveal ( this . _comparePickerNode ! , { focus : true , select : true } ) ;
155+
156+ return ;
157+ }
152158
153159 ref = pick . ref ;
154160 }
@@ -165,15 +171,25 @@ export class CompareNode extends ViewNode<CompareView> {
165171 if ( repoPath === undefined ) {
166172 repoPath = await getRepoPathOrPrompt ( `Compare in which repository${ GlyphChars . Ellipsis } ` ) ;
167173 }
168- if ( repoPath === undefined ) return ;
174+ if ( repoPath === undefined ) {
175+ await this . view . show ( ) ;
176+ await this . view . reveal ( this . _comparePickerNode ! , { focus : true , select : true } ) ;
177+
178+ return ;
179+ }
169180
170181 let autoCompare = false ;
171182 if ( ref === undefined ) {
172183 const pick = await new ReferencesQuickPick ( repoPath ) . show ( `Compare${ GlyphChars . Ellipsis } ` , {
173184 allowEnteringRefs : true ,
174185 checkmarks : false
175186 } ) ;
176- if ( pick === undefined || pick instanceof CommandQuickPickItem ) return ;
187+ if ( pick === undefined ) {
188+ await this . view . show ( ) ;
189+ await this . view . reveal ( this . _comparePickerNode ! , { focus : true , select : true } ) ;
190+
191+ return ;
192+ }
177193
178194 ref = pick . ref ;
179195
@@ -183,9 +199,8 @@ export class CompareNode extends ViewNode<CompareView> {
183199 this . _selectedRef = { label : this . getRefName ( ref ) , repoPath : repoPath , ref : ref } ;
184200 setCommandContext ( CommandContext . ViewsCanCompare , true ) ;
185201
186- await this . view . show ( ) ;
187-
188202 void ( await this . triggerChange ( ) ) ;
203+ await this . view . reveal ( this . _comparePickerNode ! , { focus : true , select : true } ) ;
189204
190205 if ( autoCompare ) {
191206 void ( await this . compareWithSelected ( ) ) ;
0 commit comments