diff --git a/ide/main.pp b/ide/main.pp index 7fcd4f9deb..260f19a411 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -7242,7 +7242,7 @@ begin end; // save main source - if (MainUnitInfo<>nil) and (not MainUnitInfo.IsVirtual) then begin + if (MainUnitInfo<>nil) and (not (sfDoNotSaveVirtualFiles in flags)) then begin if MainUnitInfo.Loaded then begin // loaded in source editor Result:=DoSaveEditorFile(MainUnitInfo.EditorIndex,