Skip to content

Commit

Permalink
Fix #9456
Browse files Browse the repository at this point in the history
  • Loading branch information
RussKie committed Aug 8, 2021
1 parent 9f551ea commit 6675b4e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions GitUI/UserControls/RevisionGrid/RevisionDataGridView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,11 @@ private Task BackgroundUpdateAsync(CancellationToken cancellationToken)
int curCount;
do
{
if (cancellationToken.IsCancellationRequested)
{
return Task.CompletedTask;
}

scrollTo = _backgroundScrollTo;
curCount = _revisionGraph.GetCachedCount();
UpdateGraph(curCount, scrollTo);
Expand All @@ -574,6 +579,11 @@ private Task BackgroundUpdateAsync(CancellationToken cancellationToken)

void UpdateGraph(int fromIndex, int toIndex)
{
if (cancellationToken.IsCancellationRequested)
{
return;
}

// Cache the next item
_revisionGraph.CacheTo(toIndex, Math.Min(fromIndex + 1500, toIndex));

Expand All @@ -584,6 +594,11 @@ void UpdateGraph(int fromIndex, int toIndex)

void UpdateRowCount(int row)
{
if (cancellationToken.IsCancellationRequested)
{
return;
}

if (RowCount < _revisionGraph.Count)
{
SetRowCountAndSelectRowsIfReady(_revisionGraph.Count);
Expand Down

0 comments on commit 6675b4e

Please sign in to comment.