@@ -39,19 +39,23 @@ internal List<Result> Search(Query query)
39
39
if ( quickFolderLinks . Count > 0 )
40
40
return quickFolderLinks ;
41
41
42
- if ( string . IsNullOrEmpty ( query . Search ) )
42
+ if ( string . IsNullOrEmpty ( querySearch ) )
43
43
return results ;
44
44
45
- if ( ! FilesFolders . IsLocationPathString ( querySearch ) )
46
- return WindowsIndexFilesAndFoldersSearch ( query , querySearch ) ;
47
-
48
- var locationPath = query . Search ;
45
+ var isEnvironmentVariable = EnvironmentVariables . IsEnvironmentVariableSearch ( querySearch ) ;
49
46
50
- if ( EnvironmentVariables . IsEnvironmentVariableSearch ( locationPath ) )
51
- return EnvironmentVariables . GetEnvironmentStringPathSuggestions ( locationPath , query , context ) ;
47
+ if ( isEnvironmentVariable )
48
+ return EnvironmentVariables . GetEnvironmentStringPathSuggestions ( querySearch , query , context ) ;
52
49
53
50
// Query is a location path with a full environment variable, eg. %appdata%\somefolder\
54
- if ( locationPath . Substring ( 1 ) . Contains ( "%" ) )
51
+ var isEnvironmentVariablePath = querySearch . Substring ( 1 ) . Contains ( "%\\ " ) ;
52
+
53
+ if ( ! FilesFolders . IsLocationPathString ( querySearch ) && ! isEnvironmentVariablePath )
54
+ return WindowsIndexFilesAndFoldersSearch ( query , querySearch ) ;
55
+
56
+ var locationPath = querySearch ;
57
+
58
+ if ( isEnvironmentVariablePath )
55
59
locationPath = EnvironmentVariables . TranslateEnvironmentVariablePath ( locationPath ) ;
56
60
57
61
if ( ! FilesFolders . LocationExists ( FilesFolders . ReturnPreviousDirectoryIfIncompleteString ( locationPath ) ) )
0 commit comments