浏览代码

* check symbol name presence before insertion into UnitsCodeCompleteWords

git-svn-id: trunk@6010 -
pierre 18 年之前
父节点
当前提交
60eddddf61
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      ide/fpcodcmp.pas

+ 7 - 2
ide/fpcodcmp.pas

@@ -207,7 +207,7 @@ var
     end;
   Var
     st : string;
-
+    CIndex : sw_integer;
   begin
     Inc(level);
     if UnitsCodeCompleteWords^.Count=MaxCollectionSize then
@@ -215,7 +215,12 @@ var
     st:=P^.GetName;
     if Length(st)>=CodeCompleteMinLen then
       if not ((level=1) and OnlyStandard and (st=UpCaseStr(CodeCompleteUnitName))) then
-        UnitsCodeCompleteWords^.Insert(NewStr(Lowcasestr(st)));
+        begin
+          st:=Lowcasestr(st);
+          UnitsCodeCompleteWords^.LookUp(st,CIndex);
+          if CIndex<>-1 then
+          UnitsCodeCompleteWords^.Insert(NewStr(st));
+        end;
     { this is wrong because it inserted args or locals of proc
       in the globals list !! PM}
     if (P^.Items<>nil) and (level=1) and