diff --git a/components/macroscript/emscriptmacro.pas b/components/macroscript/emscriptmacro.pas index ba657c0614..93c4bac024 100644 --- a/components/macroscript/emscriptmacro.pas +++ b/components/macroscript/emscriptmacro.pas @@ -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); diff --git a/ideintf/idecommands.pas b/ideintf/idecommands.pas index 6184ede210..6c7c0c5036 100644 --- a/ideintf/idecommands.pas +++ b/ideintf/idecommands.pas @@ -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.