@@ -27,30 +27,30 @@ public static string GetPathWithActionKeyword(string path, ResultType type, stri
27
27
28
28
var usePathSearchActionKeyword = Settings . PathSearchKeywordEnabled && ! Settings . SearchActionKeywordEnabled ;
29
29
30
- var pathSearchActionKeyword = Settings . PathSearchActionKeyword == Query . GlobalPluginWildcardSign
31
- ? string . Empty
30
+ var pathSearchActionKeyword = Settings . PathSearchActionKeyword == Query . GlobalPluginWildcardSign
31
+ ? string . Empty
32
32
: $ "{ Settings . PathSearchActionKeyword } ";
33
33
34
34
var searchActionKeyword = Settings . SearchActionKeyword == Query . GlobalPluginWildcardSign
35
35
? string . Empty
36
36
: $ "{ Settings . SearchActionKeyword } ";
37
37
38
38
var keyword = usePathSearchActionKeyword ? pathSearchActionKeyword : searchActionKeyword ;
39
-
39
+
40
40
var formatted_path = path ;
41
41
42
42
if ( type == ResultType . Folder )
43
- // the seperator is needed so when navigating the folder structure contents of the folder are listed
44
- formatted_path = path . EndsWith ( Constants . DirectorySeperator ) ? path : path + Constants . DirectorySeperator ;
43
+ // the separator is needed so when navigating the folder structure contents of the folder are listed
44
+ formatted_path = path . EndsWith ( Constants . DirectorySeparator ) ? path : path + Constants . DirectorySeparator ;
45
45
46
46
return $ "{ keyword } { formatted_path } ";
47
47
}
48
48
49
49
public static string GetAutoCompleteText ( string title , Query query , string path , ResultType resultType )
50
50
{
51
51
return ! Settings . PathSearchKeywordEnabled && ! Settings . SearchActionKeywordEnabled
52
- ? $ "{ query . ActionKeyword } { title } " // Only Quick Access action keyword is used in this scenario
53
- : GetPathWithActionKeyword ( path , resultType , query . ActionKeyword ) ;
52
+ ? $ "{ query . ActionKeyword } { title } " // Only Quick Access action keyword is used in this scenario
53
+ : GetPathWithActionKeyword ( path , resultType , query . ActionKeyword ) ;
54
54
}
55
55
56
56
public static Result CreateResult ( Query query , SearchResult result )
@@ -187,9 +187,9 @@ private static string ToReadableSize(long pDrvSize, int pi)
187
187
188
188
internal static Result CreateOpenCurrentFolderResult ( string path , string actionKeyword , bool windowsIndexed = false )
189
189
{
190
- // Path passed from PathSearchAsync ends with Constants.DirectorySeperator ('\'), need to remove the seperator
190
+ // Path passed from PathSearchAsync ends with Constants.DirectorySeparator ('\'), need to remove the separator
191
191
// so it's consistent with folder results returned by index search which does not end with one
192
- var folderPath = path . TrimEnd ( Constants . DirectorySeperator ) ;
192
+ var folderPath = path . TrimEnd ( Constants . DirectorySeparator ) ;
193
193
194
194
return new Result
195
195
{
@@ -215,9 +215,9 @@ internal static Result CreateOpenCurrentFolderResult(string path, string actionK
215
215
216
216
internal static Result CreateFileResult ( string filePath , Query query , int score = 0 , bool windowsIndexed = false )
217
217
{
218
- Result . PreviewInfo preview = IsMedia ( Path . GetExtension ( filePath ) ) ? new Result . PreviewInfo {
219
- IsMedia = true ,
220
- PreviewImagePath = filePath ,
218
+ Result . PreviewInfo preview = IsMedia ( Path . GetExtension ( filePath ) ) ? new Result . PreviewInfo
219
+ {
220
+ IsMedia = true , PreviewImagePath = filePath ,
221
221
} : Result . PreviewInfo . Default ;
222
222
223
223
var title = Path . GetFileName ( filePath ) ;
@@ -246,6 +246,7 @@ internal static Result CreateFileResult(string filePath, Query query, int score
246
246
{
247
247
FileName = filePath ,
248
248
UseShellExecute = true ,
249
+ WorkingDirectory = Settings . UseLocationAsWorkingDir ? Path . GetDirectoryName ( filePath ) : string . Empty ,
249
250
Verb = "runas" ,
250
251
} ) ;
251
252
}
@@ -286,16 +287,19 @@ internal static Result CreateFileResult(string filePath, Query query, int score
286
287
public static bool IsMedia ( string extension )
287
288
{
288
289
if ( string . IsNullOrEmpty ( extension ) )
289
- {
290
- return false ;
290
+ {
291
+ return false ;
291
292
}
292
293
else
293
294
{
294
295
return MediaExtensions . Contains ( extension . ToLowerInvariant ( ) ) ;
295
296
}
296
297
}
297
298
298
- public static readonly string [ ] MediaExtensions = { ".jpg" , ".png" , ".avi" , ".mkv" , ".bmp" , ".gif" , ".wmv" , ".mp3" , ".flac" , ".mp4" } ;
299
+ public static readonly string [ ] MediaExtensions =
300
+ {
301
+ ".jpg" , ".png" , ".avi" , ".mkv" , ".bmp" , ".gif" , ".wmv" , ".mp3" , ".flac" , ".mp4"
302
+ } ;
299
303
}
300
304
301
305
public enum ResultType
0 commit comments