Bläddra i källkod

Fix the similarity distance to actually make sense.

git-svn-id: file:///var/svn/tigccpp/trunk/tigcc/ide@864 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 18 år sedan
förälder
incheckning
46f36b0606
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      CodeCompletion/CompletionForm.pas

+ 2 - 2
CodeCompletion/CompletionForm.pas

@@ -294,14 +294,14 @@ function TCompForm.ShowSymbolInfo(Symbol: string = ''): Boolean;
 		i := 1;
 		while (i <= l) and (UpCase(A[i]) = UpCase(B[i])) do
 			Inc(i);
-		Result := Abs(i - l);
+		Result := l + 1 - i;
 	end;
 	function Similar(const A, B: string): Boolean;
 	var
 		l: Integer;
 	begin
 		l := Min(Length(A), Length(B));
-		Result := SimilarityDistance(A, B) < (l shr 1);
+		Result := SimilarityDistance(A, B) <= (l shr 1);
 	end;
 var
 	M: TMemoComponent;