mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
fix environment variable search to be case insensitive
This commit is contained in:
parent
cbefd4e511
commit
5ff278230b
1 changed files with 6 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
|
@ -18,12 +18,14 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
|
||||
internal static Dictionary<string, string> LoadEnvironmentStringPaths()
|
||||
{
|
||||
var envStringPaths = new Dictionary<string, string>();
|
||||
var envStringPaths = new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);
|
||||
|
||||
foreach (DictionaryEntry special in Environment.GetEnvironmentVariables())
|
||||
{
|
||||
if (Directory.Exists(special.Value.ToString()))
|
||||
{
|
||||
// Variables are returned with a mixture of all upper/lower case.
|
||||
// Call ToLower() to make them look consitent
|
||||
envStringPaths.Add(special.Key.ToString().ToLower(), special.Value.ToString());
|
||||
}
|
||||
}
|
||||
|
|
@ -82,11 +84,12 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
|
||||
foreach (var p in environmentVariables)
|
||||
{
|
||||
if (p.Key.StartsWith(search))
|
||||
if (p.Key.StartsWith(search, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
results.Add(new ResultManager(context).CreateFolderResult($"%{p.Key}%", p.Value, p.Value, query));
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue