|
@@ -15,16 +15,12 @@
|
|
|
|
|
|
{$define MODIFIEDINDEBUG}
|
|
{$define MODIFIEDINDEBUG}
|
|
|
|
|
|
-function TIDEApp.AskRecompileIfModified:boolean;
|
|
|
|
|
|
+function TIDEApp.CheckModifiedEditor:boolean;
|
|
var
|
|
var
|
|
PW,PPW : PSourceWindow;
|
|
PW,PPW : PSourceWindow;
|
|
- Checkmodifiededitor : boolean;
|
|
|
|
|
|
+ Checkmodified : boolean;
|
|
begin
|
|
begin
|
|
- AskRecompileIfModified:=false;
|
|
|
|
-{$ifdef MODIFIEDINDEBUG}
|
|
|
|
- if not AskRecompileIfModifiedFlag then
|
|
|
|
- exit;
|
|
|
|
- Checkmodifiededitor:=false;
|
|
|
|
|
|
+ Checkmodified:=false;
|
|
PW:=FirstEditorWindow;
|
|
PW:=FirstEditorWindow;
|
|
PPW:=PW;
|
|
PPW:=PW;
|
|
while assigned(PW) do
|
|
while assigned(PW) do
|
|
@@ -34,7 +30,7 @@ begin
|
|
if pw^.editor^.getmodified then
|
|
if pw^.editor^.getmodified then
|
|
if pw^.editor^.core^.getmodifytime > LastCompileTime then
|
|
if pw^.editor^.core^.getmodifytime > LastCompileTime then
|
|
begin
|
|
begin
|
|
- Checkmodifiededitor:=true;
|
|
|
|
|
|
+ Checkmodified:=true;
|
|
break;
|
|
break;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -44,7 +40,16 @@ begin
|
|
If PW=PPW then
|
|
If PW=PPW then
|
|
break;
|
|
break;
|
|
end;
|
|
end;
|
|
- if Checkmodifiededitor then
|
|
|
|
|
|
+ CheckModifiedEditor:=Checkmodified;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+function TIDEApp.AskRecompileIfModified:boolean;
|
|
|
|
+begin
|
|
|
|
+ AskRecompileIfModified:=false;
|
|
|
|
+{$ifdef MODIFIEDINDEBUG}
|
|
|
|
+ if not AskRecompileIfModifiedFlag then
|
|
|
|
+ exit;
|
|
|
|
+ if CheckModifiedEditor then
|
|
begin
|
|
begin
|
|
if (MessageBox(#3+'You''ve edited a file, recompile the project?',nil,mfinformation+mfyesbutton+mfnobutton)=cmYes) then
|
|
if (MessageBox(#3+'You''ve edited a file, recompile the project?',nil,mfinformation+mfyesbutton+mfnobutton)=cmYes) then
|
|
begin
|
|
begin
|
|
@@ -187,7 +192,7 @@ begin
|
|
{$endif}
|
|
{$endif}
|
|
begin
|
|
begin
|
|
if (not ExistsFile(ExeFile)) or (CompilationPhase<>cpDone) or
|
|
if (not ExistsFile(ExeFile)) or (CompilationPhase<>cpDone) or
|
|
- NeedRecompile(cRun,false) then
|
|
|
|
|
|
+ NeedRecompile(cRun,false) or CheckModifiedEditor then
|
|
begin
|
|
begin
|
|
DoCompile(cRun);
|
|
DoCompile(cRun);
|
|
if CompilationPhase<>cpDone then
|
|
if CompilationPhase<>cpDone then
|
|
@@ -235,6 +240,9 @@ begin
|
|
else
|
|
else
|
|
Debugger^.Run;
|
|
Debugger^.Run;
|
|
RunDirect:=false;
|
|
RunDirect:=false;
|
|
|
|
+ {we are about to run debuger, AutoSave first}
|
|
|
|
+ SaveCancelled:=false;
|
|
|
|
+ AutoSave; {ignore result, ignore if canceled}
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
{$endif ndef NODEBUG}
|
|
{$endif ndef NODEBUG}
|