mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 14:36:09 +02:00
IDE: completion box: fixed cancel execution on error
git-svn-id: trunk@22057 -
This commit is contained in:
parent
df7648cf43
commit
bf25b88f22
@ -4124,35 +4124,41 @@ Begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
CurCompletionControl := Sender as TSynCompletion;
|
CurCompletionControl := Sender as TSynCompletion;
|
||||||
S := TStringList.Create;
|
S := TStringList.Create;
|
||||||
Prefix := CurCompletionControl.CurrentString;
|
try
|
||||||
CurEdit:=GetActiveSE.EditorComponent;
|
Prefix := CurCompletionControl.CurrentString;
|
||||||
case CurrentCompletionType of
|
CurEdit:=GetActiveSE.EditorComponent;
|
||||||
ctIdentCompletion:
|
case CurrentCompletionType of
|
||||||
if not InitIdentCompletion(S) then exit;
|
ctIdentCompletion:
|
||||||
|
if not InitIdentCompletion(S) then begin
|
||||||
|
CurCompletionControl.ItemList.Clear;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
ctWordCompletion:
|
ctWordCompletion:
|
||||||
begin
|
begin
|
||||||
ccSelection:='';
|
ccSelection:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ctTemplateCompletion:
|
ctTemplateCompletion:
|
||||||
begin
|
begin
|
||||||
ccSelection:='';
|
ccSelection:='';
|
||||||
for I:=0 to FCodeTemplateModul.Completions.Count-1 do begin
|
for I:=0 to FCodeTemplateModul.Completions.Count-1 do begin
|
||||||
NewStr:=FCodeTemplateModul.Completions[I];
|
NewStr:=FCodeTemplateModul.Completions[I];
|
||||||
if NewStr<>'' then begin
|
if NewStr<>'' then begin
|
||||||
NewStr:=#3'B'+NewStr+#3'b';
|
NewStr:=#3'B'+NewStr+#3'b';
|
||||||
while length(NewStr)<10+4 do NewStr:=NewStr+' ';
|
while length(NewStr)<10+4 do NewStr:=NewStr+' ';
|
||||||
NewStr:=NewStr+' '+FCodeTemplateModul.CompletionComments[I];
|
NewStr:=NewStr+' '+FCodeTemplateModul.CompletionComments[I];
|
||||||
S.Add(NewStr);
|
S.Add(NewStr);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
CurCompletionControl.ItemList := S;
|
||||||
|
finally
|
||||||
|
S.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
CurCompletionControl.ItemList := S;
|
|
||||||
S.Free;
|
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user