From 11a403bf19a48e88fa4f6739f8dd7a2b7b62b996 Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 16 Feb 2011 23:11:37 +0000 Subject: [PATCH] IDE, SourceEditor: FocusEditor to honour locks / CleanUp UpdatePageNames git-svn-id: trunk@29582 - --- ide/sourceeditor.pp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index 34d001a52e..695a0ba469 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -579,7 +579,7 @@ type private FManager: TSourceEditorManager; FUpdateLock, FFocusLock: Integer; - FUpdateFlags: set of (ufPageNames, ufTabsAndPage, ufStatusBar, ufProjectFiles); + FUpdateFlags: set of (ufPageNames, ufTabsAndPage, ufStatusBar, ufProjectFiles, ufFocusEditor); FPageIndex: Integer; fAutoFocusLock: integer; FIncrementalSearchPos: TPoint; // last set position @@ -5534,8 +5534,8 @@ begin include(FUpdateFlags, ufPageNames); exit; end; - for i:=0 to PageCount-1 do - FindSourceEditorWithPageIndex(i).UpdatePageName; + for i := 0 to EditorCount - 1 do + Editors[i].UpdatePageName; UpdateTabsAndPageTitle; end; @@ -5865,6 +5865,7 @@ begin if (ufTabsAndPage in FUpdateFlags) then UpdateTabsAndPageTitle; if (ufStatusBar in FUpdateFlags) then UpdateStatusBar; if (ufProjectFiles in FUpdateFlags) then UpdateProjectFiles; + if (ufFocusEditor in FUpdateFlags) then FocusEditor; FUpdateFlags := []; end; end; @@ -6541,6 +6542,10 @@ procedure TSourceNotebook.FocusEditor; var SrcEdit: TSourceEditor; begin + if FUpdateLock > 0 then begin + include(FUpdateFlags, ufFocusEditor); + exit; + end; if (fAutoFocusLock>0) then exit; SrcEdit:=GetActiveSE; if SrcEdit=nil then exit;