@@ -168,7 +168,11 @@ private static string ToReadableSize(long pDrvSize, int pi)
168168
169169 internal static Result CreateOpenCurrentFolderResult ( string path , bool windowsIndexed = false )
170170 {
171- var folderName = path . TrimEnd ( Constants . DirectorySeperator ) . Split ( new [ ]
171+ // Path passed from PathSearchAsync ends with Constants.DirectorySeperator ('\'), need to remove the seperator
172+ // so it's consistent with folder results returned by index search which does not end with one
173+ var folderPath = path . TrimEnd ( Constants . DirectorySeperator ) ;
174+
175+ var folderName = folderPath . TrimEnd ( Constants . DirectorySeperator ) . Split ( new [ ]
172176 {
173177 Path . DirectorySeparatorChar
174178 } , StringSplitOptions . None ) . Last ( ) ;
@@ -186,19 +190,19 @@ internal static Result CreateOpenCurrentFolderResult(string path, bool windowsIn
186190 Title = title ,
187191 SubTitle = $ "Use > to search within { subtitleFolderName } , " +
188192 $ "* to search for file extensions or >* to combine both searches.",
189- AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder ) ,
190- IcoPath = path ,
193+ AutoCompleteText = GetPathWithActionKeyword ( folderPath , ResultType . Folder ) ,
194+ IcoPath = folderPath ,
191195 Score = 500 ,
192- CopyText = path ,
196+ CopyText = folderPath ,
193197 Action = _ =>
194198 {
195- Context . API . OpenDirectory ( path ) ;
199+ Context . API . OpenDirectory ( folderPath ) ;
196200 return true ;
197201 } ,
198202 ContextData = new SearchResult
199203 {
200204 Type = ResultType . Folder ,
201- FullPath = path ,
205+ FullPath = folderPath ,
202206 WindowsIndexed = windowsIndexed
203207 }
204208 } ;
0 commit comments