codetools: identifier completion: put exact matches at beginning

git-svn-id: trunk@12960 -
This commit is contained in:
mattias 2007-11-21 22:23:20 +00:00
parent 0c5ee1ee92
commit afd12b522a
2 changed files with 7 additions and 2 deletions

View File

@ -31,7 +31,8 @@ interface
uses
Classes, SysUtils,
CodeAtom, CodeCache, KeywordFuncLists, CustomCodeTool, FindDeclarationTool, AVL_Tree;
FileProcs, CodeAtom, CodeCache, KeywordFuncLists, CustomCodeTool,
FindDeclarationTool, AVL_Tree;
type

View File

@ -492,7 +492,11 @@ begin
{$IFDEF ShowFilteredIdents}
DebugLn('::: FILTERED ITEM ',FFilteredList.Count,' ',GetIdentifier(CurItem.Identifier));
{$ENDIF}
FFilteredList.Add(CurItem);
if length(Prefix)=GetIdentLen(CurItem.Identifier) then
// put exact matches at the beginning
FFilteredList.Insert(0,CurItem)
else
FFilteredList.Add(CurItem);
end;
AnAVLNode:=FItems.FindSuccessor(AnAVLNode);
end;