Skip to content

Commit 259d82e

Browse files
authored
Address feedback to the scrollable list view from Andy (#3600)
1 parent f1b2043 commit 259d82e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

PSReadLine/Prediction.Views.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ internal override void GetSuggestion(string userInput)
389389
_listItems = GetHistorySuggestions(userInput, HistoryMaxCount);
390390
if (_listItems?.Count > 0)
391391
{
392-
_sources = new List<SourceInfo>() { new SourceInfo(SuggestionEntry.HistorySource, _listItems.Count - 1, -1) };
392+
_sources = new List<SourceInfo>() { new SourceInfo(SuggestionEntry.HistorySource, _listItems.Count - 1, prevSourceEndIndex: -1) };
393393
}
394394
}
395395
}
@@ -546,6 +546,7 @@ private void AggregateSuggestions()
546546
int count = _cacheList2[index] - num;
547547
if (count > 0)
548548
{
549+
// If we had at least one source, we take the end index of the last source in the list.
549550
int prevEndIndex = _sources.Count > 0 ? _sources[_sources.Count - 1].EndIndex : -1;
550551
int endIndex = _listItems.Count - 1;
551552
_sources.Add(new SourceInfo(_listItems[endIndex].Source, endIndex, prevEndIndex));

0 commit comments

Comments
 (0)