@@ -27,16 +27,16 @@ 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 )
@@ -49,8 +49,8 @@ public static string GetPathWithActionKeyword(string path, ResultType type, stri
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 )
@@ -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