Skip to content

Commit a66b4cd

Browse files
committed
New method to check for environment variable
1 parent 484eb9c commit a66b4cd

File tree

1 file changed

+9
-7
lines changed
  • Plugins/Flow.Launcher.Plugin.Folder

1 file changed

+9
-7
lines changed

Plugins/Flow.Launcher.Plugin.Folder/Main.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ public List<Result> Query(Query query)
5858
var results = GetUserFolderResults(query);
5959

6060
string search = query.Search.ToLower();
61-
if (!IsDriveOrSharedFolder(search))
61+
if (!IsDriveOrSharedFolder(search) && !IsEnvironmentVariableSearch(search))
62+
{
6263
return results;
64+
}
6365

64-
if (search.StartsWith("%"))
66+
if (IsEnvironmentVariableSearch(search))
6567
{
6668
results.AddRange(GetEnvironmentStringPathResults(search, query));
6769
}
@@ -79,18 +81,18 @@ public List<Result> Query(Query query)
7981
return results;
8082
}
8183

84+
private static bool IsEnvironmentVariableSearch(string search)
85+
{
86+
return _envStringPaths != null && search.StartsWith("%");
87+
}
88+
8289
private static bool IsDriveOrSharedFolder(string search)
8390
{
8491
if (search.StartsWith(@"\\"))
8592
{ // shared folder
8693
return true;
8794
}
8895

89-
if (_envStringPaths != null && search.StartsWith("%"))
90-
{ // environment string formatted folder
91-
return true;
92-
}
93-
9496
if (_driverNames != null && _driverNames.Any(search.StartsWith))
9597
{ // normal drive letter
9698
return true;

0 commit comments

Comments
 (0)