IDE: completion box: fixed cancel execution on error

git-svn-id: trunk@22057 -
This commit is contained in:
mattias 2009-10-06 12:59:11 +00:00
parent df7648cf43
commit bf25b88f22

View File

@ -4124,11 +4124,15 @@ Begin
{$ENDIF} {$ENDIF}
CurCompletionControl := Sender as TSynCompletion; CurCompletionControl := Sender as TSynCompletion;
S := TStringList.Create; S := TStringList.Create;
try
Prefix := CurCompletionControl.CurrentString; Prefix := CurCompletionControl.CurrentString;
CurEdit:=GetActiveSE.EditorComponent; CurEdit:=GetActiveSE.EditorComponent;
case CurrentCompletionType of case CurrentCompletionType of
ctIdentCompletion: ctIdentCompletion:
if not InitIdentCompletion(S) then exit; if not InitIdentCompletion(S) then begin
CurCompletionControl.ItemList.Clear;
exit;
end;
ctWordCompletion: ctWordCompletion:
begin begin
@ -4152,7 +4156,9 @@ Begin
end; end;
CurCompletionControl.ItemList := S; CurCompletionControl.ItemList := S;
finally
S.Free; S.Free;
end;
CurCompletionControl.CurrentString:=Prefix; CurCompletionControl.CurrentString:=Prefix;
// set colors // set colors
if (CurEdit<>nil) and (CurCompletionControl.TheForm<>nil) then begin if (CurEdit<>nil) and (CurCompletionControl.TheForm<>nil) then begin