IDE: word identifier completion: fix position for ContainsFilter

git-svn-id: trunk@58171 -
This commit is contained in:
ondrej 2018-06-07 15:14:27 +00:00
parent f22151f9d2
commit 7617a31139
2 changed files with 11 additions and 7 deletions

View File

@ -6495,14 +6495,21 @@ begin
FIdentifierWordCompletionWordList.Clear;
AWordCompletion.GetWordList(FIdentifierWordCompletionWordList, Sender.Prefix, Sender.ContainsFilter, False, 100);
for I := FIdentifierWordCompletionWordList.Count-1 downto 0 do
FilteredList.Capacity := FilteredList.Count+FIdentifierWordCompletionWordList.Count;
for I := 0 to FIdentifierWordCompletionWordList.Count-1 do
begin
if Sender.FindIdentifier(PChar(FIdentifierWordCompletionWordList[I]))=nil then
begin
New := CIdentifierListItem.Create(WordCompatibility, False, WordHistoryIndex,
PChar(FIdentifierWordCompletionWordList[I]), WordLevel, nil, nil, ctnWord);
New := CIdentifierListItem.Create(WordCompatibility, False, 0,
PChar(FIdentifierWordCompletionWordList[I]), 0, nil, nil, ctnWord);
FIdentifierWordCompletionWordList.Objects[I] := New;
FilteredList.Add(New);
if Sender.ContainsFilter and (Sender.Prefix<>'')
and (strlicomp(PChar(Sender.Prefix), PChar(FIdentifierWordCompletionWordList[I]), Length(Sender.Prefix))=0) then
begin
FilteredList.Insert(PriorityCount, New);
Inc(PriorityCount);
end else
FilteredList.Add(New);
end;
end;
end;

View File

@ -120,10 +120,7 @@ function BreakLinesInText(const s: string; MaxLineLength: integer): string;
const
ctnWord = ctnUser + 1;
// make sure words are added last if sorting is in place
WordCompatibility = icompUnknown;
WordHistoryIndex = High(Integer);
WordLevel = High(Integer);
implementation