EditorMacros / PascalScript: fix missing cmd registration

git-svn-id: trunk@38423 -
This commit is contained in:
martin 2012-08-29 02:03:28 +00:00
parent a2a43cfe89
commit efbdc6b949
2 changed files with 16 additions and 3 deletions

View File

@ -5,8 +5,9 @@ unit EMScriptMacro;
interface
uses
Classes, SysUtils, SrcEditorIntf, Controls, SynEdit, SynEditKeyCmds, EMScriptClasses,
Laz2_XMLCfg, LazLoggerBase, uPSCompiler, uPSRuntime, uPSUtils, uPSC_std, uPSR_std;
Classes, SysUtils, SrcEditorIntf, IDECommands, Controls, SynEdit, SynEditKeyCmds,
EMScriptClasses, Laz2_XMLCfg, LazLoggerBase, uPSCompiler, uPSRuntime, uPSUtils, uPSC_std,
uPSR_std;
type
@ -113,8 +114,10 @@ begin
begin
SIRegisterTObject(Sender);
//SIRegister_Std(Sender);
if Sender is TEMSPSPascalCompiler then
if Sender is TEMSPSPascalCompiler then begin
GetEditorCommandValues(@TEMSPSPascalCompiler(Sender).AddECFuncToCompEnum);
GetIDEEditorCommandValues(@TEMSPSPascalCompiler(Sender).AddECFuncToCompEnum);
end;
CompRegisterBasics(TheCompiler);
CompRegisterTSynEdit(TheCompiler);
@ -129,6 +132,7 @@ end;
procedure AddECFuncToExec;
begin
GetEditorCommandValues(@TheExec.AddECFuncToExecEnum);
GetIDEEditorCommandValues(@TheExec.AddECFuncToExecEnum);
ExecRegisterBasics(TheExec);
ExecRegisterTSynEdit(TheCLassImp);
TheExec.RegisterFunctionName('CALLER', @HandleGetCaller, TheExec, nil);

View File

@ -666,6 +666,7 @@ function CompareIDEShortCutKey1s(Data1, Data2: Pointer): integer;
function IdentToIDECommand(const Ident: string; var Cmd: longint): boolean;
function IDECommandToIdent(Cmd: longint; var Ident: string): boolean;
procedure GetIDEEditorCommandValues(Proc: TGetStrProc);
implementation
@ -1579,5 +1580,13 @@ begin
Result := IntToIdent(Cmd, Ident, IDEEditorCommandStrs);
end;
procedure GetIDEEditorCommandValues(Proc: TGetStrProc);
var
i: integer;
begin
for i := Low(IDEEditorCommandStrs) to High(IDEEditorCommandStrs) do
Proc(IDEEditorCommandStrs[I].Name);
end;
end.