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