Skip to content

Commit

Permalink
Don't change the new selection which was selected while revision grid…
Browse files Browse the repository at this point in the history
… was refreshing. Closes gitextensions#3583.
  • Loading branch information
jbialobr committed Mar 22, 2017
1 parent d4c2ab1 commit bdbd501
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion GitUI/UserControls/RevisionGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ public void SetInitialRevision(GitRevision initialSelectedRevision)
_initialSelectedRevision = initialSelectedRevision != null ? initialSelectedRevision.Guid : null;
}

private bool _isRefreshingRevisions = false;
private bool _isLoading;
private void RevisionsLoading(object sender, DvcsGraph.LoadingEventArgs e)
{
Expand Down Expand Up @@ -711,7 +712,16 @@ private void RevisionsSelectionChanged(object sender, EventArgs e)
_parentChildNavigationHistory.RevisionsSelectionChanged();

if (Revisions.SelectedRows.Count > 0)
{
LastRowIndex = Revisions.SelectedRows[0].Index;
//if there was selected a new revision while data is being loaded
//then don't change the new selection when restoring selected revisions after data is loaded
if (_isRefreshingRevisions && !Revisions.UpdatingVisibleRows)
{
LastSelectedRows = Revisions.SelectedIds;
}

}

SelectionTimer.Enabled = false;
SelectionTimer.Stop();
Expand Down Expand Up @@ -994,6 +1004,7 @@ public void ForceRefreshRevisions()
Loading.Visible = true;
Loading.BringToFront();
_isLoading = true;
_isRefreshingRevisions = true;
base.Refresh();

IndexWatcher.Reset();
Expand Down Expand Up @@ -1176,6 +1187,7 @@ private void GitGetCommitsCommandExited(object sender, EventArgs e)
//NoCommits.BringToFront();
Revisions.Visible = false;
Loading.Visible = false;
_isRefreshingRevisions = false;
}, this);
}
else
Expand All @@ -1185,8 +1197,8 @@ private void GitGetCommitsCommandExited(object sender, EventArgs e)
{
UpdateGraph(null);
Loading.Visible = false;
_isRefreshingRevisions = false;
SelectInitialRevision();
_isLoading = false;
if (ShowBuildServerInfo)
BuildServerWatcher.LaunchBuildServerInfoFetchOperation();
}, this);
Expand Down

0 comments on commit bdbd501

Please sign in to comment.