@@ -466,29 +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 ) ;
471-
472- var statusMessage = session . IsCheckedOut ?
473- App . Resources . NavigateToEditorStatusMessage : App . Resources . NavigateToEditorNotCheckedOutStatusMessage ;
474- textView . GotAggregateFocus += ( s , e ) =>
475- statusBar . ShowMessage ( statusMessage ) ;
476-
477- textView . LostAggregateFocus += ( s , e ) =>
478- statusBar . ShowMessage ( string . Empty ) ;
469+ var vsTextView = vsEditorAdaptersFactory . GetViewAdapter ( textView ) ;
470+ EnableNavigateToEditor ( vsTextView , session , file ) ;
479471 }
480472
481- void EnableNavigateToEditor ( IVsTextView textView , IPullRequestSession session , IPullRequestSessionFile file )
473+ void EnableNavigateToEditor ( IVsTextView vsTextView , IPullRequestSession session , IPullRequestSessionFile file )
482474 {
483475 var commandGroup = VSConstants . CMDSETID . StandardCommandSet2K_guid ;
484476 var commandId = ( int ) VSConstants . VSStd2KCmdID . RETURN ;
485- new TextViewCommandDispatcher ( textView , commandGroup , commandId ) . Exec +=
477+ new TextViewCommandDispatcher ( vsTextView , commandGroup , commandId ) . Exec +=
486478 async ( s , e ) => await DoNavigateToEditor ( session , file ) ;
487479
488480 var contextMenuCommandGroup = new Guid ( Guids . guidContextMenuSetString ) ;
489481 var goToCommandId = PkgCmdIDList . openFileInSolutionCommand ;
490- new TextViewCommandDispatcher ( textView , contextMenuCommandGroup , goToCommandId ) . Exec +=
482+ new TextViewCommandDispatcher ( vsTextView , contextMenuCommandGroup , goToCommandId ) . Exec +=
491483 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 ) ;
492500 }
493501
494502 async Task DoNavigateToEditor ( IPullRequestSession session , IPullRequestSessionFile file )
0 commit comments