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

Commit 981ad00

Browse files
Responding to tne enter key in the PullRequest TreeView
1 parent 05362a2 commit 981ad00

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@
294294
Background="Transparent"
295295
BorderThickness="0"
296296
Margin="0 6 0 0"
297+
KeyUp="FileListKeyUp"
297298
MouseRightButtonDown="FileListMouseRightButtonDown"
298299
MouseDoubleClick="FileListMouseDoubleClick">
299300
<TreeView.ItemContainerStyle>

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,18 @@ void ShowErrorInStatusBar(string message, Exception e)
202202
ns?.ShowMessage(message + ": " + e.Message);
203203
}
204204

205+
private void FileListKeyUp(object sender, KeyEventArgs e)
206+
{
207+
if (e.Key == Key.Return)
208+
{
209+
var file = (e.OriginalSource as FrameworkElement)?.DataContext as IPullRequestFileNode;
210+
if (file != null)
211+
{
212+
DoDiffFile(file, false).Forget();
213+
}
214+
}
215+
}
216+
205217
void FileListMouseDoubleClick(object sender, MouseButtonEventArgs e)
206218
{
207219
var file = (e.OriginalSource as FrameworkElement)?.DataContext as IPullRequestFileNode;

0 commit comments

Comments
 (0)