mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-27 05:10:19 +02:00
SourceEditor: less AutoSizing while opening several files
This commit is contained in:
parent
8afb2ae4ad
commit
5aeacf3a9f
27
ide/main.pp
27
ide/main.pp
@ -5884,11 +5884,10 @@ begin
|
||||
FileList := TStringList.Create;
|
||||
FileList.AddStrings(FileNames);
|
||||
try
|
||||
SourceEditorManager.IncUpdateLock;
|
||||
if FilenameExtIs(FileList[0],'lpr',false) then
|
||||
begin
|
||||
SourceEditorManager.IncUpdateLock;
|
||||
OpenEditorFile(FileList[0],-1,WindowIndex,Nil,[ofAddToRecent]);
|
||||
SourceEditorManager.DecUpdateLock;
|
||||
FileList.Delete(0);
|
||||
end
|
||||
else if FilenameExtIs(FileList[0],'lpi',false) then
|
||||
@ -5898,6 +5897,7 @@ begin
|
||||
end;
|
||||
MaybeOpenEditorFiles(FileList, WindowIndex);
|
||||
finally
|
||||
SourceEditorManager.DecUpdateLock;
|
||||
FileList.Free;
|
||||
end;
|
||||
UpdateRecentFilesEnv;
|
||||
@ -6620,15 +6620,20 @@ begin
|
||||
and (AskSaveProject(lisDoYouStillWantToOpenAnotherProject, lisDiscardChangesAndOpenProject)<>mrOk) then
|
||||
exit;
|
||||
|
||||
Result:=DoCloseProject;
|
||||
if Result=mrAbort then exit;
|
||||
try
|
||||
SourceEditorManager.IncUpdateLock;
|
||||
Result:=DoCloseProject;
|
||||
if Result=mrAbort then exit;
|
||||
|
||||
// create a new project
|
||||
//debugln('TMainIDE.DoOpenProjectFile B');
|
||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.DoOpenProjectFile B');{$ENDIF}
|
||||
Project1:=CreateProjectObject(ProjectDescriptorProgram,
|
||||
ProjectDescriptorProgram);
|
||||
Result:=InitOpenedProjectFile(AFileName, Flags);
|
||||
// create a new project
|
||||
//debugln('TMainIDE.DoOpenProjectFile B');
|
||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TMainIDE.DoOpenProjectFile B');{$ENDIF}
|
||||
Project1:=CreateProjectObject(ProjectDescriptorProgram,
|
||||
ProjectDescriptorProgram);
|
||||
Result:=InitOpenedProjectFile(AFileName, Flags);
|
||||
finally
|
||||
SourceEditorManager.DecUpdateLock;
|
||||
end;
|
||||
|
||||
{$push}{$overflowchecks off}
|
||||
Inc(BookmarksStamp);
|
||||
@ -7904,6 +7909,7 @@ begin
|
||||
Files:=nil;
|
||||
try
|
||||
// load and delete the file
|
||||
SourceEditorManager.IncUpdateLock;
|
||||
try
|
||||
List.LoadFromFile(Filename);
|
||||
except
|
||||
@ -7927,6 +7933,7 @@ begin
|
||||
if Files.Count>0 then
|
||||
OpenFiles(Files);
|
||||
finally
|
||||
SourceEditorManager.DecUpdateLock;
|
||||
List.Free;
|
||||
Files.Free;
|
||||
end;
|
||||
|
@ -8078,6 +8078,7 @@ begin
|
||||
FUpdateFlags := [];
|
||||
DebugLn(SRCED_LOCK, ['TSourceNotebook.IncUpdateLockInternal']);
|
||||
FPageIndex := PageIndex;
|
||||
FNotebook.DisableAutoSizing;
|
||||
end;
|
||||
inc(FUpdateLock);
|
||||
end;
|
||||
@ -8095,6 +8096,7 @@ begin
|
||||
if (ufFocusEditor in FUpdateFlags) then FocusEditor;
|
||||
if (ufActiveEditorChanged in FUpdateFlags) then DoActiveEditorChanged;
|
||||
FUpdateFlags := [];
|
||||
FNotebook.EnableAutoSizing;
|
||||
DebugLnExit(SRCED_LOCK, ['<< TSourceNotebook.DecUpdateLockInternal']);
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user