mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 11:19:26 +02:00
IDE: fixed clear modified files on close project
git-svn-id: branches/fixes_2_0@59562 -
This commit is contained in:
parent
e09b7587c8
commit
7ecfb56820
@ -2686,6 +2686,9 @@ begin
|
||||
if Result in [mrAbort,mrCancel] then exit;
|
||||
Result:=mrOk;
|
||||
end;
|
||||
// mark file as unmodified
|
||||
if (AnUnitInfo.Source<>nil) and AnUnitInfo.Source.Modified then
|
||||
AnUnitInfo.Source.Clear;
|
||||
|
||||
// add to recent file list
|
||||
if (not AnUnitInfo.IsVirtual) and (not (cfProjectClosing in Flags)) then
|
||||
@ -4048,6 +4051,8 @@ begin
|
||||
end;
|
||||
|
||||
function CloseProject: TModalResult;
|
||||
var
|
||||
SrcEdit: TSourceEditor;
|
||||
begin
|
||||
if Project1=nil then exit(mrOk);
|
||||
|
||||
@ -4067,14 +4072,16 @@ begin
|
||||
SourceEditorManager.IncUpdateLock;
|
||||
try
|
||||
while SourceEditorManager.SourceEditorCount > 0 do begin
|
||||
Result:=CloseEditorFile(
|
||||
SourceEditorManager.SourceEditors[SourceEditorManager.SourceEditorCount-1],
|
||||
[cfProjectClosing]);
|
||||
SrcEdit:=SourceEditorManager.SourceEditors[SourceEditorManager.SourceEditorCount-1];
|
||||
Result:=CloseEditorFile(SrcEdit,[cfProjectClosing]);
|
||||
if Result=mrAbort then exit;
|
||||
end;
|
||||
finally
|
||||
SourceEditorManager.DecUpdateLock;
|
||||
end;
|
||||
// remove all source modifications
|
||||
CodeToolBoss.SourceCache.ClearAllModified;
|
||||
|
||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('CloseProject B');{$ENDIF}
|
||||
IncreaseCompilerParseStamp;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user