@@ -27,30 +27,30 @@ public static string GetPathWithActionKeyword(string path, ResultType type, stri
2727
2828 var usePathSearchActionKeyword = Settings . PathSearchKeywordEnabled && ! Settings . SearchActionKeywordEnabled ;
2929
30- var pathSearchActionKeyword = Settings . PathSearchActionKeyword == Query . GlobalPluginWildcardSign
31- ? string . Empty
30+ var pathSearchActionKeyword = Settings . PathSearchActionKeyword == Query . GlobalPluginWildcardSign
31+ ? string . Empty
3232 : $ "{ Settings . PathSearchActionKeyword } ";
3333
3434 var searchActionKeyword = Settings . SearchActionKeyword == Query . GlobalPluginWildcardSign
3535 ? string . Empty
3636 : $ "{ Settings . SearchActionKeyword } ";
3737
3838 var keyword = usePathSearchActionKeyword ? pathSearchActionKeyword : searchActionKeyword ;
39-
39+
4040 var formatted_path = path ;
4141
4242 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 ;
4545
4646 return $ "{ keyword } { formatted_path } ";
4747 }
4848
4949 public static string GetAutoCompleteText ( string title , Query query , string path , ResultType resultType )
5050 {
5151 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 ) ;
5454 }
5555
5656 public static Result CreateResult ( Query query , SearchResult result )
@@ -187,9 +187,9 @@ private static string ToReadableSize(long pDrvSize, int pi)
187187
188188 internal static Result CreateOpenCurrentFolderResult ( string path , string actionKeyword , bool windowsIndexed = false )
189189 {
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
191191 // 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 ) ;
193193
194194 return new Result
195195 {
@@ -215,9 +215,9 @@ internal static Result CreateOpenCurrentFolderResult(string path, string actionK
215215
216216 internal static Result CreateFileResult ( string filePath , Query query , int score = 0 , bool windowsIndexed = false )
217217 {
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 ,
221221 } : Result . PreviewInfo . Default ;
222222
223223 var title = Path . GetFileName ( filePath ) ;
@@ -246,6 +246,7 @@ internal static Result CreateFileResult(string filePath, Query query, int score
246246 {
247247 FileName = filePath ,
248248 UseShellExecute = true ,
249+ WorkingDirectory = Settings . UseLocationAsWorkingDir ? Path . GetDirectoryName ( filePath ) : string . Empty ,
249250 Verb = "runas" ,
250251 } ) ;
251252 }
@@ -286,16 +287,19 @@ internal static Result CreateFileResult(string filePath, Query query, int score
286287 public static bool IsMedia ( string extension )
287288 {
288289 if ( string . IsNullOrEmpty ( extension ) )
289- {
290- return false ;
290+ {
291+ return false ;
291292 }
292293 else
293294 {
294295 return MediaExtensions . Contains ( extension . ToLowerInvariant ( ) ) ;
295296 }
296297 }
297298
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+ } ;
299303 }
300304
301305 public enum ResultType
0 commit comments