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