This commit is contained in:
Arkadii Fedushin 2026-05-07 14:20:23 -07:00 committed by GitHub
commit 09d5fcf012
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 5 deletions

View file

@ -6366,14 +6366,17 @@ procedure TfrmMain.LoadTabsCommandLine(Params: TCommandLineParams);
if Length(aPath) <> 0 then
begin
aPath:= ReplaceEnvVars(ReplaceTilde(aPath));
if not mbFileSystemEntryExists(aPath) then
if not mbFileSystemEntryExists(aPath) and not aPath.StartsWith('wfx://') then
aPath:= GetDeepestExistingPath(aPath);
if Length(aPath) <> 0 then
begin
if Params.NewTab then
AddTab(aNoteBook, aPath)
else
aNoteBook.ActivePage.FileView.ChangePathAndSetActiveFile(aPath)
if aPath.StartsWith('wfx://') then
Commands.cm_ChangeDir([aPath])
else
aNoteBook.ActivePage.FileView.ChangePathAndSetActiveFile(aPath);
end;
end;
end;

View file

@ -31,11 +31,14 @@ uses
function DecodePath(const Path: String): String;
begin
Result := TrimQuotes(Path);
if Pos(fileScheme, Result) = 1 then
if not Result.StartsWith('wfx://') then
begin
Result:= URIDecode(Copy(Result, 8, MaxInt));
if Pos(fileScheme, Result) = 1 then
begin
Result:= URIDecode(Copy(Result, 8, MaxInt));
end;
Result:= GetAbsoluteFileName(IncludeTrailingBackslash(GetCurrentDir), Result);
end;
Result:= GetAbsoluteFileName(IncludeTrailingBackslash(GetCurrentDir), Result);
end;
procedure ProcessCommandLineParams;