IDE: SourceEditor: reduce work when applying global options

git-svn-id: trunk@39958 -
This commit is contained in:
martin 2013-01-24 20:43:41 +00:00
parent 4d2e6cf9be
commit d67ac0c78c
2 changed files with 27 additions and 4 deletions

View File

@ -4780,10 +4780,15 @@ begin
if Restore then exit;
if Project1<>nil then
Project1.UpdateAllSyntaxHighlighter;
UpdateHighlighters(True);
SourceEditorManager.ReloadEditorOptions;
ReloadMenuShortCuts;
UpdateMacroListViewer;
SourceEditorManager.BeginGlobalUpdate;
try
UpdateHighlighters(True);
SourceEditorManager.ReloadEditorOptions;
ReloadMenuShortCuts;
UpdateMacroListViewer;
finally
SourceEditorManager.EndGlobalUpdate;
end;
end;
procedure TMainIDE.DoCodetoolsOptionsAfterWrite(Sender: TObject; Restore: boolean);

View File

@ -1060,6 +1060,8 @@ type
procedure OnIdle(Sender: TObject; var Done: Boolean);
procedure LockAllEditorsInSourceChangeCache;
procedure UnlockAllEditorsInSourceChangeCache;
procedure BeginGlobalUpdate;
procedure EndGlobalUpdate;
procedure CloseFile(AEditor: TSourceEditorInterface);
// history jumping
procedure HistoryJump(Sender: TObject; CloseAction: TJumpHistoryAction);
@ -9654,6 +9656,22 @@ begin
end;
end;
procedure TSourceEditorManager.BeginGlobalUpdate;
var
i: integer;
begin
for i:=0 to SourceEditorCount - 1 do
SourceEditors[i].BeginGlobalUpdate;
end;
procedure TSourceEditorManager.EndGlobalUpdate;
var
i: integer;
begin
for i:=0 to SourceEditorCount - 1 do
SourceEditors[i].EndGlobalUpdate;
end;
procedure TSourceEditorManager.CloseFile(AEditor: TSourceEditorInterface);
var
i, j: Integer;