1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-08-13 12:29:01 +00:00

Fix selection highlight update call

Change acf19870 fixed one bug but introduced another: the call to
update the highlight happened before the selection was restored, so
it could potentially refer to a line that no longer existed.
This commit is contained in:
Andy McFadden 2018-10-10 17:35:44 -07:00
parent a4e3680655
commit 457c981a2e

View File

@ -932,6 +932,11 @@ namespace SourceGen.AppForms {
string timerStr = mReanalysisTimer.DumpToString("ProjectView timers:");
mShowAnalysisTimersDialog.BodyText = timerStr;
}
// Lines may have moved around. Update the selection highlight. It's important
// we do it here, and not down in DoRefreshProject(), because at that point the
// ListView's selection index could be referencing a line off the end.
UpdateSelectionHighlight();
}
/// <summary>
@ -1029,7 +1034,6 @@ namespace SourceGen.AppForms {
mReanalysisTimer.StartTask("Generate DisplayList");
mDisplayList.GenerateAll();
mReanalysisTimer.EndTask("Generate DisplayList");
UpdateSelectionHighlight();
}
#endregion Project management