Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit cb51a1c

Browse files
committed
Enable navigate from read-only PR file
1 parent 71121df commit cb51a1c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/GitHub.VisualStudio/Views/GitHubPane/PullRequestDetailView.xaml.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ async Task DoOpenFile(IPullRequestFileNode file, bool workingDirectory)
111111
if (!workingDirectory)
112112
{
113113
AddBufferTag(buffer, ViewModel.Session, fullPath, null);
114+
115+
var textView = NavigationService.FindActiveView();
116+
EnableNavigateToEditor(textView, file);
114117
}
115118
}
116119

@@ -232,9 +235,14 @@ void AddBufferTag(ITextBuffer buffer, IPullRequestSession session, string path,
232235
void EnableNavigateToEditor(IWpfTextView textView, IPullRequestFileNode file)
233236
{
234237
var view = EditorAdaptersFactoryService.GetViewAdapter(textView);
238+
EnableNavigateToEditor(view, file);
239+
}
240+
241+
void EnableNavigateToEditor(IVsTextView textView, IPullRequestFileNode file)
242+
{
235243
var commandGroup = VSConstants.CMDSETID.StandardCommandSet2K_guid;
236244
var commandId = (int)VSConstants.VSStd2KCmdID.RETURN;
237-
var dispatcher = new TextViewCommandDispatcher(view, commandGroup, commandId);
245+
var dispatcher = new TextViewCommandDispatcher(textView, commandGroup, commandId);
238246
dispatcher.Exec += async (s, e) => await DoOpenLiveFile(file);
239247
}
240248

0 commit comments

Comments
 (0)