2
0
Эх сурвалжийг харах

Make functional fp parameter return to last directory: -R, -R+ and -R-

Margers 5 сар өмнө
parent
commit
2d7a8d4440

+ 1 - 0
packages/ide/fp.pas

@@ -172,6 +172,7 @@ begin
             else
             if (copy(Param,3,1)='-') then
               StartupOptions:=StartupOptions and not soHeapMonitor;
+            OverrideLastDirOption:=true;
           end else
 {$ifdef go32v2}
         if (UpcaseStr(Param)='NOLFN') or (UpcaseStr(Param)='N') then

+ 8 - 2
packages/ide/fpdesk.pas

@@ -1037,7 +1037,12 @@ begin
       OK:=ReadCodeComplete(F) and OK;
     if ((DesktopFileFlags and dfCodeTemplates)<>0) then
       OK:=ReadCodeTemplates(F) and OK;
-    if ((DesktopFileFlags and dfReturnToLastDir)<>0) then
+    if not OverrideLastDirOption then
+      if ((DesktopFileFlags and dfReturnToLastDir)<>0) then
+        StartupOptions:=StartupOptions or soReturnToLastDir
+      else
+        StartupOptions:=StartupOptions and( not soReturnToLastDir);
+    if ((StartupOptions and soReturnToLastDir)<>0) then
       OK:=ReadReturnToLastDir(F) and OK;
 {$ifdef Unix}
     OK:=ReadKeys(F) and OK;
@@ -1084,7 +1089,8 @@ begin
         OK:=OK and WriteCodeComplete(F);
       if ((DesktopFileFlags and dfCodeTemplates)<>0) then
         OK:=OK and WriteCodeTemplates(F);
-      if ((DesktopFileFlags and dfReturnToLastDir)<>0) then
+      {if ((DesktopFileFlags and dfReturnToLastDir)<>0) then
+        always write last dir }
         OK:=WriteReturnToLastDir(F) and OK;
 {$ifdef Unix}
       OK:=OK and WriteKeys(F);

+ 1 - 0
packages/ide/fpvars.pas

@@ -103,6 +103,7 @@ const INIFileName      : string = ININame;
       CtrlMouseAction  : integer = acTopicSearch;
       AltMouseAction   : integer = acBrowseSymbol;
       StartupOptions   : longint = 0;
+      OverrideLastDirOption : boolean = false;
       LastExitCode     : integer = 0;
       ASCIIChart       : PFPASCIIChart = nil;
       BackgroundPath   : string = BackgroundName;