@@ -664,6 +664,19 @@ public async Task SetPathBoxDropDownFlyoutAsync(MenuFlyout flyout, PathBoxItem p
664
664
}
665
665
}
666
666
667
+ private static string NormalizePathInput ( string currentInput , bool isFtp )
668
+ {
669
+ if ( currentInput . Contains ( '/' ) && ! isFtp )
670
+ currentInput = currentInput . Replace ( "/" , "\\ " , StringComparison . Ordinal ) ;
671
+
672
+ currentInput = currentInput . Replace ( "\\ \\ " , "\\ " , StringComparison . Ordinal ) ;
673
+
674
+ if ( currentInput . StartsWith ( '\\ ' ) && ! currentInput . StartsWith ( "\\ \\ " , StringComparison . Ordinal ) )
675
+ currentInput = currentInput . Insert ( 0 , "\\ " ) ;
676
+
677
+ return currentInput ;
678
+ }
679
+
667
680
public async Task CheckPathInputAsync ( string currentInput , string currentSelectedPath , IShellPage shellPage )
668
681
{
669
682
if ( currentInput . StartsWith ( '>' ) )
@@ -685,13 +698,7 @@ await DialogDisplayHelper.ShowDialogAsync("CommandNotExecutable".GetLocalizedRes
685
698
686
699
var isFtp = FtpHelpers . IsFtpPath ( currentInput ) ;
687
700
688
- if ( currentInput . Contains ( '/' ) && ! isFtp )
689
- currentInput = currentInput . Replace ( "/" , "\\ " , StringComparison . Ordinal ) ;
690
-
691
- currentInput = currentInput . Replace ( "\\ \\ " , "\\ " , StringComparison . Ordinal ) ;
692
-
693
- if ( currentInput . StartsWith ( '\\ ' ) && ! currentInput . StartsWith ( "\\ \\ " , StringComparison . Ordinal ) )
694
- currentInput = currentInput . Insert ( 0 , "\\ " ) ;
701
+ currentInput = NormalizePathInput ( currentInput , isFtp ) ;
695
702
696
703
if ( currentSelectedPath == currentInput || string . IsNullOrWhiteSpace ( currentInput ) )
697
704
return ;
@@ -810,8 +817,10 @@ public async Task SetAddressBarSuggestionsAsync(AutoSuggestBox sender, IShellPag
810
817
else
811
818
{
812
819
IsCommandPaletteOpen = false ;
813
- var isFtp = FtpHelpers . IsFtpPath ( sender . Text ) ;
814
- var expandedPath = StorageFileExtensions . GetResolvedPath ( sender . Text , isFtp ) ;
820
+ var currentInput = sender . Text ;
821
+ var isFtp = FtpHelpers . IsFtpPath ( currentInput ) ;
822
+ currentInput = NormalizePathInput ( currentInput , isFtp ) ;
823
+ var expandedPath = StorageFileExtensions . GetResolvedPath ( currentInput , isFtp ) ;
815
824
var folderPath = PathNormalization . GetParentDir ( expandedPath ) ?? expandedPath ;
816
825
StorageFolderWithPath folder = await shellpage . FilesystemViewModel . GetFolderWithPathFromPathAsync ( folderPath ) ;
817
826
0 commit comments