Browse Source

* check symbol name presence before insertion into UnitsCodeCompleteWords

git-svn-id: trunk@6010 -
pierre 18 years ago
parent
commit
60eddddf61
1 changed files with 7 additions and 2 deletions
  1. 7 2
      ide/fpcodcmp.pas

+ 7 - 2
ide/fpcodcmp.pas

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