mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-07 09:00:35 +02:00
parent
ab2f7d54a5
commit
319aa319a8
@ -1057,8 +1057,16 @@ var BackupFilename, CounterFilename: string;
|
||||
begin
|
||||
Result:=mrOk;
|
||||
if not (FileExistsUTF8(Filename)) then exit;
|
||||
// check if file in lpi
|
||||
IsPartOfProject:=(Project1<>nil)
|
||||
and (Project1.FindFile(Filename,[pfsfOnlyProjectFiles])<>nil);
|
||||
// check if file in source directory of project
|
||||
if (not IsPartOfProject) and (Project1<>nil)
|
||||
and (SearchDirectoryInSearchPath(ExtractFilePath(Filename),
|
||||
Project1.SourceDirectories.CreateSearchPathFromAllFiles)>0)
|
||||
then
|
||||
IsPartOfProject:=true;
|
||||
// check options
|
||||
if IsPartOfProject then
|
||||
BackupInfo:=EnvironmentOptions.BackupInfoProjectFiles
|
||||
else
|
||||
@ -1066,6 +1074,7 @@ begin
|
||||
if (BackupInfo.BackupType=bakNone)
|
||||
or ((BackupInfo.BackupType=bakSameName) and (BackupInfo.SubDirectory='')) then
|
||||
exit;
|
||||
// create backup
|
||||
FilePath:=ExtractFilePath(Filename);
|
||||
FileExt:=ExtractFileExt(Filename);
|
||||
FileNameOnly:=ExtractFilenameOnly(Filename);
|
||||
|
@ -5397,7 +5397,7 @@ begin
|
||||
// stream text to file
|
||||
TxtCompStream.Position:=0;
|
||||
LFMCode.LoadFromStream(TxtCompStream);
|
||||
Result:=SaveCodeBufferToFile(LFMCode,LFMCode.Filename);
|
||||
Result:=SaveCodeBufferToFile(LFMCode,LFMCode.Filename,true);
|
||||
if not Result=mrOk then exit;
|
||||
Result:=mrCancel;
|
||||
finally
|
||||
|
Loading…
Reference in New Issue
Block a user