diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index 82029e8c5..58fe31dd6 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -127,6 +127,8 @@ Warning: This is not a Fast Sort option, searches may be slow + Search Full Path + Click to launch or install Everything Everything Installation Installing Everything service. Please wait... diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs index 4bb8a0cdd..344707892 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs @@ -42,29 +42,38 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything private async ValueTask ClickToInstallEverythingAsync(ActionContext _) { var installedPath = await EverythingDownloadHelper.PromptDownloadIfNotInstallAsync(Settings.EverythingInstalledPath, Main.Context.API); + if (installedPath == null) { Main.Context.API.ShowMsgError("Unable to find Everything.exe"); + return false; } + Settings.EverythingInstalledPath = installedPath; Process.Start(installedPath, "-startup"); + return true; } public async IAsyncEnumerable SearchAsync(string search, [EnumeratorCancellation] CancellationToken token) { await ThrowIfEverythingNotAvailableAsync(token); + if (token.IsCancellationRequested) yield break; - var option = new EverythingSearchOption(search, Settings.SortOption); + + var option = new EverythingSearchOption(search, Settings.SortOption, IsFullPathSearch: Settings.EverythingSearchFullPath); + await foreach (var result in EverythingApi.SearchAsync(option, token)) yield return result; } public async IAsyncEnumerable ContentSearchAsync(string plainSearch, - string contentSearch, [EnumeratorCancellation] CancellationToken token) + string contentSearch, + [EnumeratorCancellation] CancellationToken token) { await ThrowIfEverythingNotAvailableAsync(token); + if (!Settings.EnableEverythingContentSearch) { throw new EngineNotAvailableException(Enum.GetName(Settings.IndexSearchEngineOption.Everything)!, @@ -74,16 +83,19 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything _ => { Settings.EnableEverythingContentSearch = true; + return ValueTask.FromResult(true); }); } + if (token.IsCancellationRequested) yield break; var option = new EverythingSearchOption(plainSearch, Settings.SortOption, true, - contentSearch); + contentSearch, + IsFullPathSearch: Settings.EverythingSearchFullPath); await foreach (var result in EverythingApi.SearchAsync(option, token)) { @@ -93,13 +105,15 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything public async IAsyncEnumerable EnumerateAsync(string path, string search, bool recursive, [EnumeratorCancellation] CancellationToken token) { await ThrowIfEverythingNotAvailableAsync(token); + if (token.IsCancellationRequested) yield break; var option = new EverythingSearchOption(search, Settings.SortOption, ParentPath: path, - IsRecursive: recursive); + IsRecursive: recursive, + IsFullPathSearch: Settings.EverythingSearchFullPath); await foreach (var result in EverythingApi.SearchAsync(option, token)) { diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs index 97bd67f2e..339eaaaaa 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs @@ -137,6 +137,8 @@ namespace Flow.Launcher.Plugin.Explorer PathEnumerationEngine == PathEnumerationEngineOption.Everything || ContentSearchEngine == ContentIndexSearchEngineOption.Everything; + public bool EverythingSearchFullPath { get; set; } = false; + #endregion internal enum ActionKeyword diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml index 593b9badc..d37772f7d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml @@ -348,6 +348,15 @@ Header="{DynamicResource plugin_explorer_everything_setting_header}" Style="{DynamicResource ExplorerTabItem}"> + + + + +