mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-21 14:39:27 +02:00
IDE, apply SourceEditor update-lock, when opening files via menu or drag/drop
git-svn-id: trunk@31995 -
This commit is contained in:
parent
fd7cd04f3f
commit
5d39026d37
44
ide/main.pp
44
ide/main.pp
@ -2836,16 +2836,21 @@ begin
|
||||
//debugln('TMainIDE.mnuOpenClicked OpenDialog.Files.Count=',dbgs(OpenDialog.Files.Count));
|
||||
if OpenDialog.Files.Count>1 then
|
||||
Include(OpenFlags,ofRegularFile);
|
||||
For I := 0 to OpenDialog.Files.Count-1 do
|
||||
Begin
|
||||
AFilename:=CleanAndExpandFilename(OpenDialog.Files.Strings[i]);
|
||||
if i<OpenDialog.Files.Count-1 then
|
||||
Include(OpenFlags,ofMultiOpen)
|
||||
else
|
||||
Exclude(OpenFlags,ofMultiOpen);
|
||||
if DoOpenEditorFile(AFilename,-1,-1,OpenFlags)=mrAbort then begin
|
||||
break;
|
||||
try
|
||||
SourceEditorManager.IncUpdateLock;
|
||||
For I := 0 to OpenDialog.Files.Count-1 do
|
||||
Begin
|
||||
AFilename:=CleanAndExpandFilename(OpenDialog.Files.Strings[i]);
|
||||
if i<OpenDialog.Files.Count-1 then
|
||||
Include(OpenFlags,ofMultiOpen)
|
||||
else
|
||||
Exclude(OpenFlags,ofMultiOpen);
|
||||
if DoOpenEditorFile(AFilename,-1,-1,OpenFlags)=mrAbort then begin
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
SourceEditorManager.DecUpdateLock;
|
||||
end;
|
||||
UpdateEnvironment;
|
||||
end;
|
||||
@ -17068,16 +17073,21 @@ begin
|
||||
if Length(FileNames) > 1 then
|
||||
Include(OpenFlags, ofRegularFile);
|
||||
|
||||
for I := 0 to High(FileNames) do
|
||||
begin
|
||||
AFilename := CleanAndExpandFilename(FileNames[I]);
|
||||
try
|
||||
SourceEditorManager.IncUpdateLock;
|
||||
for I := 0 to High(FileNames) do
|
||||
begin
|
||||
AFilename := CleanAndExpandFilename(FileNames[I]);
|
||||
|
||||
if I < High(FileNames) then
|
||||
Include(OpenFlags, ofMultiOpen)
|
||||
else
|
||||
Exclude(OpenFlags, ofMultiOpen);
|
||||
if I < High(FileNames) then
|
||||
Include(OpenFlags, ofMultiOpen)
|
||||
else
|
||||
Exclude(OpenFlags, ofMultiOpen);
|
||||
|
||||
if DoOpenEditorFile(AFilename, -1, -1, OpenFlags) = mrAbort then Break;
|
||||
if DoOpenEditorFile(AFilename, -1, -1, OpenFlags) = mrAbort then Break;
|
||||
end;
|
||||
finally
|
||||
SourceEditorManager.DecUpdateLock;
|
||||
end;
|
||||
|
||||
SetRecentFilesMenu;
|
||||
|
@ -5915,8 +5915,10 @@ end;
|
||||
|
||||
procedure TSourceNotebook.IncUpdateLockInternal;
|
||||
begin
|
||||
if FUpdateLock = 0 then
|
||||
if FUpdateLock = 0 then begin
|
||||
FUpdateFlags := [];
|
||||
Screen.Cursor := crHourGlass;
|
||||
end;
|
||||
inc(FUpdateLock);
|
||||
end;
|
||||
|
||||
@ -5924,6 +5926,7 @@ procedure TSourceNotebook.DecUpdateLockInternal;
|
||||
begin
|
||||
dec(FUpdateLock);
|
||||
if FUpdateLock = 0 then begin
|
||||
Screen.Cursor := crDefault;
|
||||
PageIndex := FPageIndex;
|
||||
if (ufPageNames in FUpdateFlags) then UpdatePageNames;
|
||||
if (ufTabsAndPage in FUpdateFlags) then UpdateTabsAndPageTitle;
|
||||
@ -5931,7 +5934,7 @@ begin
|
||||
if (ufProjectFiles in FUpdateFlags) then UpdateProjectFiles;
|
||||
if (ufFocusEditor in FUpdateFlags) then FocusEditor;
|
||||
if (ufActiveEditorChanged in FUpdateFlags) then DoActiveEditorChanged;
|
||||
FUpdateFlags := [];
|
||||
FUpdateFlags := [];
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user