File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -389,7 +389,7 @@ internal override void GetSuggestion(string userInput)
389
389
_listItems = GetHistorySuggestions ( userInput , HistoryMaxCount ) ;
390
390
if ( _listItems ? . Count > 0 )
391
391
{
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 ) } ;
393
393
}
394
394
}
395
395
}
@@ -546,6 +546,7 @@ private void AggregateSuggestions()
546
546
int count = _cacheList2 [ index ] - num ;
547
547
if ( count > 0 )
548
548
{
549
+ // If we had at least one source, we take the end index of the last source in the list.
549
550
int prevEndIndex = _sources . Count > 0 ? _sources [ _sources . Count - 1 ] . EndIndex : - 1 ;
550
551
int endIndex = _listItems . Count - 1 ;
551
552
_sources . Add ( new SourceInfo ( _listItems [ endIndex ] . Source , endIndex , prevEndIndex ) ) ;
You can’t perform that action at this time.
0 commit comments