IDE: fixed TSourceNotebook.ReloadHighlighters using wrong PageIndex

git-svn-id: trunk@22172 -
This commit is contained in:
mattias 2009-10-14 12:37:57 +00:00
parent 39fd8546c7
commit 5c3bf6fbea
2 changed files with 4 additions and 3 deletions

View File

@ -3102,6 +3102,7 @@ end;
function TProject.UnitWithEditorIndex(Index:integer):TUnitInfo;
begin
if Index<0 then exit(nil);
Result:=fFirst[uilWithEditorIndex];
while (Result<>nil) and (Result.EditorIndex<>Index) do begin
Result:=Result.fNext[uilWithEditorIndex];

View File

@ -672,7 +672,7 @@ type
procedure ShowFPDocEditor;
procedure UpdateFPDocEditor;
property Editors[Index:integer]:TSourceEditor read GetEditors;
property Editors[Index:integer]:TSourceEditor read GetEditors; // !!! not ordered for PageIndex
function EditorCount:integer;
function Count: integer; override;
function Empty: boolean;
@ -5394,7 +5394,7 @@ var
begin
try
TheFileList:= TStringList.Create;
for i:= 0 to self.EditorCount -1 do
for i:= 0 to EditorCount -1 do
begin
//only if file exists on disk
if FilenameIsAbsolute(Editors[i].FileName) and
@ -6622,7 +6622,7 @@ var
begin
for i := 0 to EditorCount-1 do begin
ASrcEdit:=Editors[i];
AnUnitInfo:=Project1.UnitWithEditorIndex(i);
AnUnitInfo:=Project1.UnitWithEditorIndex(ASrcEdit.PageIndex);
if AnUnitInfo<>nil then
ASrcEdit.SyntaxHighlighterType:=AnUnitInfo.SyntaxHighlighter;
end;