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

This commit is contained in:
Margers 2025-02-17 08:42:23 +00:00 committed by Michael Van Canneyt
parent 3dd4b7afbf
commit 2d7a8d4440
3 changed files with 10 additions and 2 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;