From 4da68d03f29382101b929e12f45ae8e91c20d78b Mon Sep 17 00:00:00 2001 From: ondrej Date: Thu, 14 Jun 2018 20:04:01 +0000 Subject: [PATCH] IDE: word identifier completion: show exact match between exact matches and in-word matches git-svn-id: trunk@58273 - --- ide/main.pp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ide/main.pp b/ide/main.pp index d2db5e3b72..151420444d 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -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<>'')