mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 13:18:08 +02:00
IDE: fix translations for color opts, broken in 900e58ed4f
by too early init.
This commit is contained in:
parent
41ef935d69
commit
83ef9dce86
@ -6,7 +6,7 @@ unit EditorSyntaxHighlighterDef;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils;
|
Classes, SysUtils, LazMethodList;
|
||||||
|
|
||||||
type
|
type
|
||||||
TLazSyntaxHighlighter =
|
TLazSyntaxHighlighter =
|
||||||
@ -121,6 +121,10 @@ var
|
|||||||
IdeSyntaxHighlighters: TIdeSyntaxHighlighterList;
|
IdeSyntaxHighlighters: TIdeSyntaxHighlighterList;
|
||||||
IdeColorSchemeList: IColorSchemeList;
|
IdeColorSchemeList: IColorSchemeList;
|
||||||
|
|
||||||
|
procedure RegisterOnIdeColorSchemeListCreated(AnHandler: TNotifyEvent);
|
||||||
|
procedure _IDE_CallOnIdeColorSchemeListCreated;
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
function GetSyntaxHighlighterCaption(h: TLazSyntaxHighlighter): string;
|
function GetSyntaxHighlighterCaption(h: TLazSyntaxHighlighter): string;
|
||||||
@ -133,5 +137,25 @@ begin
|
|||||||
Result := IdeSyntaxHighlighters.GetLazSyntaxHighlighterType(IdeSyntaxHighlighters.GetIdForName(s)){%H-};
|
Result := IdeSyntaxHighlighters.GetLazSyntaxHighlighterType(IdeSyntaxHighlighters.GetIdForName(s)){%H-};
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
OnIdeColorSchemeListCreated: TMethodList;
|
||||||
|
procedure RegisterOnIdeColorSchemeListCreated(AnHandler: TNotifyEvent);
|
||||||
|
begin
|
||||||
|
if IdeColorSchemeList <> nil then begin
|
||||||
|
AnHandler(nil);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if OnIdeColorSchemeListCreated = nil then
|
||||||
|
OnIdeColorSchemeListCreated := TMethodList.Create;
|
||||||
|
OnIdeColorSchemeListCreated.Add(TMethod(AnHandler));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure _IDE_CallOnIdeColorSchemeListCreated;
|
||||||
|
begin
|
||||||
|
OnIdeColorSchemeListCreated.CallNotifyEvents(nil);
|
||||||
|
FreeAndNil(OnIdeColorSchemeListCreated);
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ type
|
|||||||
TTodoEditorHandler = class
|
TTodoEditorHandler = class
|
||||||
procedure DoEditorCreated(Sender: TObject);
|
procedure DoEditorCreated(Sender: TObject);
|
||||||
procedure DoColorsChanged(Sender: TObject);
|
procedure DoColorsChanged(Sender: TObject);
|
||||||
|
procedure DoRegisterAttribs(Sender: TObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -131,6 +132,11 @@ begin
|
|||||||
attr.ApplyTo(CommentAttribNote);
|
attr.ApplyTo(CommentAttribNote);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TTodoEditorHandler.DoRegisterAttribs(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RegisterAttribs;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TSynEditTodoMarkup }
|
{ TSynEditTodoMarkup }
|
||||||
|
|
||||||
procedure TSynEditTodoMarkup.BeginMarkup;
|
procedure TSynEditTodoMarkup.BeginMarkup;
|
||||||
@ -536,7 +542,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterAttribs;
|
RegisterOnIdeColorSchemeListCreated(@TTodoEditorHandler(nil).DoRegisterAttribs);
|
||||||
finalization
|
finalization
|
||||||
FreeAttribs;
|
FreeAttribs;
|
||||||
end.
|
end.
|
||||||
|
@ -2947,6 +2947,8 @@ begin
|
|||||||
FileList.Free;
|
FileList.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
IdeColorSchemeList := Singleton;
|
||||||
|
_IDE_CallOnIdeColorSchemeListCreated;
|
||||||
Result := Singleton;
|
Result := Singleton;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -8436,7 +8438,6 @@ end;
|
|||||||
initialization
|
initialization
|
||||||
RegisterIDEOptionsGroup(GroupEditor, TEditorOptions);
|
RegisterIDEOptionsGroup(GroupEditor, TEditorOptions);
|
||||||
IdeSyntaxHighlighters := HighlighterList;
|
IdeSyntaxHighlighters := HighlighterList;
|
||||||
IdeColorSchemeList := ColorSchemeFactory;
|
|
||||||
|
|
||||||
finalization
|
finalization
|
||||||
IdeColorSchemeList := nil;
|
IdeColorSchemeList := nil;
|
||||||
|
Loading…
Reference in New Issue
Block a user