mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 00:49:29 +02:00
IDE: BackupFileForWrite: invalidate codetools file load date
git-svn-id: trunk@51370 -
This commit is contained in:
parent
3c2bf43f60
commit
72246cb241
@ -1430,6 +1430,7 @@ function BackupFileForWrite(const Filename, BackupFilename: string): boolean;
|
||||
|
||||
var
|
||||
FHandle: THandle;
|
||||
Code: TCodeBuffer;
|
||||
{$IFdef MSWindows}
|
||||
OldAttr: Longint;
|
||||
{$ELSE}
|
||||
@ -1455,6 +1456,9 @@ begin
|
||||
// create empty file
|
||||
FHandle := FileCreate(UTF8ToSys(FileName));
|
||||
FileClose(FHandle);
|
||||
Code:=CodeToolBoss.FindFile(Filename);
|
||||
if Code<>nil then
|
||||
Code.InvalidateLoadDate;
|
||||
end
|
||||
else // file is a symlink/hardlink or locked or rename failed => copy file (slow)
|
||||
if not CopyFile(Filename, BackupFilename) then exit;
|
||||
|
Loading…
Reference in New Issue
Block a user