mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 02:49:30 +02:00
IDE: Code-Templates, use default (from resource) if file does not exist.
git-svn-id: trunk@62271 -
This commit is contained in:
parent
80b7820ea9
commit
c018dfafb9
@ -5237,6 +5237,8 @@ function TEditorOptions.LoadCodeTemplates(AnAutoComplete: TSynEditAutoComplete
|
||||
): TModalResult;
|
||||
var
|
||||
s: String;
|
||||
data: TResourceStream;
|
||||
i: Int64;
|
||||
begin
|
||||
s := CodeTemplateFileNameExpand;
|
||||
Result := mrAbort;
|
||||
@ -5247,6 +5249,16 @@ begin
|
||||
except
|
||||
Result := mrAbort;
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
data := TResourceStream.Create(HInstance, PChar('lazarus_dci_file'), PChar(RT_RCDATA));
|
||||
i := data.Size;
|
||||
if i > 0 then begin
|
||||
SetLength(s, i);
|
||||
data.Read(s[1], i);
|
||||
AnAutoComplete.AutoCompleteList.Text := s;
|
||||
end;
|
||||
data.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user