IDE: word identifier completion: show exact match between exact matches and in-word matches

git-svn-id: trunk@58273 -
This commit is contained in:
ondrej 2018-06-14 20:04:01 +00:00
parent 18d410eb28
commit 4da68d03f2

View File

@ -6464,7 +6464,7 @@ procedure TMainIDE.DoAddWordsToIdentCompletion(Sender: TIdentifierList;
FilteredList: TFPList; PriorityCount: Integer);
var
New: TIdentifierListItem;
I: Integer;
I, OldPriorityCount: Integer;
begin
if not(
FIdentifierWordCompletionEnabled and (
@ -6480,6 +6480,7 @@ begin
end else
FIdentifierWordCompletionWordList.Clear;
OldPriorityCount := PriorityCount;
PriorityCount := FilteredList.Count;
AWordCompletion.GetWordList(FIdentifierWordCompletionWordList, Sender.Prefix, Sender.ContainsFilter, False, 100);
FilteredList.Capacity := FilteredList.Count+FIdentifierWordCompletionWordList.Count;
@ -6491,8 +6492,8 @@ begin
PChar(FIdentifierWordCompletionWordList[I]), 0, nil, nil, ctnWord);
FIdentifierWordCompletionWordList.Objects[I] := New;
if SameText(Sender.Prefix, FIdentifierWordCompletionWordList[I]) then
begin // show exact match at top
FilteredList.Insert(0, New);
begin // show exact match between exact matches and in-word-matches
FilteredList.Insert(OldPriorityCount, New);
Inc(PriorityCount);
end else
if Sender.ContainsFilter and (Sender.Prefix<>'')