mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 12:29:29 +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;
|
if Result in [mrAbort,mrCancel] then exit;
|
||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
end;
|
end;
|
||||||
|
// mark file as unmodified
|
||||||
|
if (AnUnitInfo.Source<>nil) and AnUnitInfo.Source.Modified then
|
||||||
|
AnUnitInfo.Source.Clear;
|
||||||
|
|
||||||
// add to recent file list
|
// add to recent file list
|
||||||
if (not AnUnitInfo.IsVirtual) and (not (cfProjectClosing in Flags)) then
|
if (not AnUnitInfo.IsVirtual) and (not (cfProjectClosing in Flags)) then
|
||||||
@ -4048,6 +4051,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function CloseProject: TModalResult;
|
function CloseProject: TModalResult;
|
||||||
|
var
|
||||||
|
SrcEdit: TSourceEditor;
|
||||||
begin
|
begin
|
||||||
if Project1=nil then exit(mrOk);
|
if Project1=nil then exit(mrOk);
|
||||||
|
|
||||||
@ -4067,14 +4072,16 @@ begin
|
|||||||
SourceEditorManager.IncUpdateLock;
|
SourceEditorManager.IncUpdateLock;
|
||||||
try
|
try
|
||||||
while SourceEditorManager.SourceEditorCount > 0 do begin
|
while SourceEditorManager.SourceEditorCount > 0 do begin
|
||||||
Result:=CloseEditorFile(
|
SrcEdit:=SourceEditorManager.SourceEditors[SourceEditorManager.SourceEditorCount-1];
|
||||||
SourceEditorManager.SourceEditors[SourceEditorManager.SourceEditorCount-1],
|
Result:=CloseEditorFile(SrcEdit,[cfProjectClosing]);
|
||||||
[cfProjectClosing]);
|
|
||||||
if Result=mrAbort then exit;
|
if Result=mrAbort then exit;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
SourceEditorManager.DecUpdateLock;
|
SourceEditorManager.DecUpdateLock;
|
||||||
end;
|
end;
|
||||||
|
// remove all source modifications
|
||||||
|
CodeToolBoss.SourceCache.ClearAllModified;
|
||||||
|
|
||||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('CloseProject B');{$ENDIF}
|
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('CloseProject B');{$ENDIF}
|
||||||
IncreaseCompilerParseStamp;
|
IncreaseCompilerParseStamp;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user