Quellcode durchsuchen

Fix the similarity distance to actually make sense.

git-svn-id: file:///var/svn/tigccpp/trunk@864 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler vor 18 Jahren
Ursprung
Commit
28da2932e3
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      tigcc/ide/CodeCompletion/CompletionForm.pas

+ 2 - 2
tigcc/ide/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;