IDE, SourceEditor: Honour UpdateLock in UpdateStatusBar, UpdatePageNames => Reduce unnecessary calls to OS

git-svn-id: trunk@29568 -
This commit is contained in:
martin 2011-02-15 21:54:35 +00:00
parent c6b9b65aa1
commit 0394cf0a93

View File

@ -5523,6 +5523,7 @@ procedure TSourceNotebook.UpdatePageNames;
var
i: Integer;
begin
if FUpdateLock > 0 then exit;
for i:=0 to PageCount-1 do
FindSourceEditorWithPageIndex(i).UpdatePageName;
UpdateTabsAndPageTitle;
@ -5837,8 +5838,11 @@ end;
procedure TSourceNotebook.DecUpdateLock;
begin
dec(FUpdateLock);
if FUpdateLock = 0 then
if FUpdateLock = 0 then begin
PageIndex := FPageIndex;
UpdatePageNames;
UpdateStatusBar;
end;
end;
procedure TSourceNotebook.NoteBookInsertPage(Index: Integer; const S: string);
@ -6638,6 +6642,7 @@ var
PanelFileMode: string;
CurEditor: TSynEdit;
begin
if FUpdateLock > 0 then exit;
if (not IsVisible) or (FUpdateLock > 0) then
begin
Include(States,snUpdateStatusBarNeeded);