Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion PSReadLine/Prediction.Views.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ internal override void GetSuggestion(string userInput)
_listItems = GetHistorySuggestions(userInput, HistoryMaxCount);
if (_listItems?.Count > 0)
{
_sources = new List<SourceInfo>() { new SourceInfo(SuggestionEntry.HistorySource, _listItems.Count - 1, -1) };
_sources = new List<SourceInfo>() { new SourceInfo(SuggestionEntry.HistorySource, _listItems.Count - 1, prevSourceEndIndex: -1) };
}
}
}
Expand Down Expand Up @@ -546,6 +546,7 @@ private void AggregateSuggestions()
int count = _cacheList2[index] - num;
if (count > 0)
{
// If we had at least one source, we take the end index of the last source in the list.
int prevEndIndex = _sources.Count > 0 ? _sources[_sources.Count - 1].EndIndex : -1;
int endIndex = _listItems.Count - 1;
_sources.Add(new SourceInfo(_listItems[endIndex].Source, endIndex, prevEndIndex));
Expand Down