mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge branch 'dev' into update_uI_hotkey_actionkeyword
This commit is contained in:
commit
d6b4b40780
2 changed files with 16 additions and 9 deletions
|
|
@ -10,7 +10,10 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
{
|
||||
internal static bool IsEnvironmentVariableSearch(string search)
|
||||
{
|
||||
return LoadEnvironmentStringPaths().Count > 0 && search.StartsWith("%") && !search.Substring(1).Contains("%");
|
||||
return LoadEnvironmentStringPaths().Count > 0
|
||||
&& search.StartsWith("%")
|
||||
&& search != "%%"
|
||||
&& !search.Contains("\\");
|
||||
}
|
||||
|
||||
internal static Dictionary<string, string> LoadEnvironmentStringPaths()
|
||||
|
|
|
|||
|
|
@ -39,19 +39,23 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
if (quickFolderLinks.Count > 0)
|
||||
return quickFolderLinks;
|
||||
|
||||
if (string.IsNullOrEmpty(query.Search))
|
||||
if (string.IsNullOrEmpty(querySearch))
|
||||
return results;
|
||||
|
||||
if (!FilesFolders.IsLocationPathString(querySearch))
|
||||
return WindowsIndexFilesAndFoldersSearch(query, querySearch);
|
||||
var isEnvironmentVariable = EnvironmentVariables.IsEnvironmentVariableSearch(querySearch);
|
||||
|
||||
var locationPath = query.Search;
|
||||
|
||||
if (EnvironmentVariables.IsEnvironmentVariableSearch(locationPath))
|
||||
return EnvironmentVariables.GetEnvironmentStringPathSuggestions(locationPath, query, context);
|
||||
if (isEnvironmentVariable)
|
||||
return EnvironmentVariables.GetEnvironmentStringPathSuggestions(querySearch, query, context);
|
||||
|
||||
// Query is a location path with a full environment variable, eg. %appdata%\somefolder\
|
||||
if (locationPath.Substring(1).Contains("%"))
|
||||
var isEnvironmentVariablePath = querySearch.Substring(1).Contains("%\\");
|
||||
|
||||
if (!FilesFolders.IsLocationPathString(querySearch) && !isEnvironmentVariablePath)
|
||||
return WindowsIndexFilesAndFoldersSearch(query, querySearch);
|
||||
|
||||
var locationPath = querySearch;
|
||||
|
||||
if (isEnvironmentVariablePath)
|
||||
locationPath = EnvironmentVariables.TranslateEnvironmentVariablePath(locationPath);
|
||||
|
||||
if (!FilesFolders.LocationExists(FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue