@@ -466,21 +466,37 @@ void AddBufferTag(
466466
467467 void EnableNavigateToEditor ( ITextView textView , IPullRequestSession session , IPullRequestSessionFile file )
468468 {
469- var view = vsEditorAdaptersFactory . GetViewAdapter ( textView ) ;
470- EnableNavigateToEditor ( view , session , file ) ;
469+ var vsTextView = vsEditorAdaptersFactory . GetViewAdapter ( textView ) ;
470+ EnableNavigateToEditor ( vsTextView , session , file ) ;
471471 }
472472
473- void EnableNavigateToEditor ( IVsTextView textView , IPullRequestSession session , IPullRequestSessionFile file )
473+ void EnableNavigateToEditor ( IVsTextView vsTextView , IPullRequestSession session , IPullRequestSessionFile file )
474474 {
475475 var commandGroup = VSConstants . CMDSETID . StandardCommandSet2K_guid ;
476476 var commandId = ( int ) VSConstants . VSStd2KCmdID . RETURN ;
477- new TextViewCommandDispatcher ( textView , commandGroup , commandId ) . Exec +=
477+ new TextViewCommandDispatcher ( vsTextView , commandGroup , commandId ) . Exec +=
478478 async ( s , e ) => await DoNavigateToEditor ( session , file ) ;
479479
480480 var contextMenuCommandGroup = new Guid ( Guids . guidContextMenuSetString ) ;
481481 var goToCommandId = PkgCmdIDList . openFileInSolutionCommand ;
482- new TextViewCommandDispatcher ( textView , contextMenuCommandGroup , goToCommandId ) . Exec +=
482+ new TextViewCommandDispatcher ( vsTextView , contextMenuCommandGroup , goToCommandId ) . Exec +=
483483 async ( s , e ) => await DoNavigateToEditor ( session , file ) ;
484+
485+ EnableNavigateStatusBarMessage ( vsTextView , session ) ;
486+ }
487+
488+ void EnableNavigateStatusBarMessage ( IVsTextView vsTextView , IPullRequestSession session )
489+ {
490+ var textView = vsEditorAdaptersFactory . GetWpfTextView ( vsTextView ) ;
491+
492+ var statusMessage = session . IsCheckedOut ?
493+ App . Resources . NavigateToEditorStatusMessage : App . Resources . NavigateToEditorNotCheckedOutStatusMessage ;
494+
495+ textView . GotAggregateFocus += ( s , e ) =>
496+ statusBar . ShowMessage ( statusMessage ) ;
497+
498+ textView . LostAggregateFocus += ( s , e ) =>
499+ statusBar . ShowMessage ( string . Empty ) ;
484500 }
485501
486502 async Task DoNavigateToEditor ( IPullRequestSession session , IPullRequestSessionFile file )
@@ -489,7 +505,7 @@ async Task DoNavigateToEditor(IPullRequestSession session, IPullRequestSessionFi
489505 {
490506 if ( ! session . IsCheckedOut )
491507 {
492- ShowInfoMessage ( "Checkout PR branch before opening file in solution." ) ;
508+ ShowInfoMessage ( App . Resources . NavigateToEditorNotCheckedOutInfoMessage ) ;
493509 return ;
494510 }
495511
0 commit comments