@@ -168,7 +168,11 @@ private static string ToReadableSize(long pDrvSize, int pi)
168
168
169
169
internal static Result CreateOpenCurrentFolderResult ( string path , bool windowsIndexed = false )
170
170
{
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 [ ]
172
176
{
173
177
Path . DirectorySeparatorChar
174
178
} , StringSplitOptions . None ) . Last ( ) ;
@@ -186,19 +190,19 @@ internal static Result CreateOpenCurrentFolderResult(string path, bool windowsIn
186
190
Title = title ,
187
191
SubTitle = $ "Use > to search within { subtitleFolderName } , " +
188
192
$ "* 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 ,
191
195
Score = 500 ,
192
- CopyText = path ,
196
+ CopyText = folderPath ,
193
197
Action = _ =>
194
198
{
195
- Context . API . OpenDirectory ( path ) ;
199
+ Context . API . OpenDirectory ( folderPath ) ;
196
200
return true ;
197
201
} ,
198
202
ContextData = new SearchResult
199
203
{
200
204
Type = ResultType . Folder ,
201
- FullPath = path ,
205
+ FullPath = folderPath ,
202
206
WindowsIndexed = windowsIndexed
203
207
}
204
208
} ;
0 commit comments