@@ -84,11 +84,13 @@ TSimbaScriptTab = class(TSimbaTab)
8484 FSavedText: String;
8585 FScriptFileName: String;
8686 FScriptTitle: String;
87+ FDiskAge: TDateTime;
8788
8889 FScriptRunner: TSimbaScriptTabRunner;
8990
9091 FOutputBox: TSimbaOutputBox;
9192
93+ procedure UpdateDiskAge ;
9294 procedure LoadDefaultScript ;
9395 procedure FindDeclarationAtCaretASync (Data: PtrInt);
9496
@@ -114,7 +116,9 @@ TSimbaScriptTab = class(TSimbaTab)
114116 property ScriptChanged: Boolean read GetScriptChanged;
115117 property Script: String read GetScript;
116118 property Editor: TSimbaEditor read FEditor;
119+ property DiskAge: TDateTime read FDiskAge;
117120
121+ procedure UpdateDiskAge ;
118122 function SaveAsDialog : String;
119123
120124 function Save (FileName: String): Boolean;
@@ -342,6 +346,14 @@ function TSimbaScriptTab.GetScriptChanged: Boolean;
342346 Result := FEditor.Text <> FSavedText;
343347end ;
344348
349+ procedure TSimbaScriptTab.UpdateDiskAge ;
350+ begin
351+ if (FScriptFileName <> ' ' ) and FileExists(FScriptFileName) then
352+ FDiskAge := FileDateToDateTime(FileAge(FScriptFileName))
353+ else
354+ FDiskAge := 0 ;
355+ end ;
356+
345357procedure TSimbaScriptTab.LoadDefaultScript ;
346358begin
347359 case SimbaSettings.Editor.DefaultScriptType.Value of
@@ -460,6 +472,7 @@ function TSimbaScriptTab.Save(FileName: String): Boolean;
460472 FScriptTitle := FScriptTitle.Before(' .simba' );
461473
462474 Caption := FScriptTitle;
475+ UpdateDiskAge();
463476end ;
464477
465478function TSimbaScriptTab.Load (FileName: String): Boolean;
@@ -490,6 +503,7 @@ function TSimbaScriptTab.Load(FileName: String): Boolean;
490503 FScriptTitle := FScriptTitle.Before(' .simba' );
491504
492505 Caption := FScriptTitle;
506+ UpdateDiskAge();
493507 if Result then
494508 SimbaIDEEvents.Notify(SimbaIDEEvent.TAB_LOADED, Self);
495509end ;
@@ -573,6 +587,9 @@ procedure TSimbaScriptTab.Run(Target: TWindowHandle);
573587begin
574588 // DebugLn('TSimbaScriptTab.Run :: ' + ScriptTitle + ' ' + ScriptFileName);
575589
590+ if SimbaTabsForm.CheckForFileChanges() then
591+ Exit;
592+
576593 if (FScriptRunner <> nil ) then
577594 FScriptRunner.Resume()
578595 else
@@ -592,6 +609,9 @@ procedure TSimbaScriptTab.Compile;
592609begin
593610 // DebugLn('TSimbaScriptTab.Compile :: ' + ScriptTitle + ' ' + ScriptFileName);
594611
612+ if SimbaTabsForm.CheckForFileChanges() then
613+ Exit;
614+
595615 if (FScriptRunner = nil ) then
596616 begin
597617 if (not FEditor.ReadOnly) and (FScriptFileName <> ' ' ) then
0 commit comments