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)
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 ) ) ;
You can’t perform that action at this time.
0 commit comments