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

Commit 2a536bc

Browse files
committed
fixed clicking on error not scrolling to the error line
1 parent 5a2830d commit 2a536bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

UI/MainWindow/MainWindowErrorResultGrid.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.IO;
3+
using System.Threading.Tasks;
34
using System.Windows;
45
using System.Windows.Controls;
56
using System.Windows.Input;
@@ -11,7 +12,7 @@ namespace SPCode.UI
1112
{
1213
public partial class MainWindow
1314
{
14-
private void ErrorResultGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
15+
private async void ErrorResultGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
1516
{
1617
var row = (ErrorDataGridRow)ErrorResultGrid.SelectedItem;
1718
if (row == null)
@@ -59,13 +60,15 @@ private void ErrorResultGrid_SelectionChanged(object sender, SelectionChangedEve
5960
{
6061
if (ed.FullFilePath == fInfo.FullName)
6162
{
63+
await Task.Delay(50);
6264
GoToErrorLine(ed, row);
6365
}
6466
}
6567

6668
// If it's not opened, open it and go to the error line
6769
if (TryLoadSourceFile(fInfo.FullName, out var editor, true, false, true) && editor != null)
6870
{
71+
await Task.Delay(50);
6972
GoToErrorLine(editor, row);
7073
}
7174
}

0 commit comments

Comments
 (0)