diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index 76736466f..8af757da9 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -28,7 +28,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search TitleHighlightData = StringMatcher.FuzzySearch(query.Search, title).MatchData, Action = c => { - if (c.SpecialKeyState.CtrlPressed || !(Settings.EnabledPathSearchKeyword || Settings.EnableSearchActionKeyword)) + if (c.SpecialKeyState.CtrlPressed || !(Settings.EnabledPathSearchKeyword || Settings.EnabledSearchActionKeyword)) { try { @@ -42,9 +42,9 @@ namespace Flow.Launcher.Plugin.Explorer.Search } } // one of it is enabled - var keyword = Settings.EnableSearchActionKeyword ? Settings.SearchActionKeyword : Settings.PathSearchActionKeyword; + var keyword = Settings.EnabledSearchActionKeyword ? Settings.SearchActionKeyword : Settings.PathSearchActionKeyword; - keyword = keyword == "*" ? "" : $"{keyword} "; + keyword = keyword == Query.GlobalPluginWildcardSign ? string.Empty : keyword + ""; string changeTo = path.EndsWith(Constants.DirectorySeperator) ? path : path + Constants.DirectorySeperator; Context.API.ChangeQuery($"{keyword}{changeTo}"); diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index 6f3996b0d..d98c5400a 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -71,7 +71,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search return allowedActionKeyword switch { - Settings.ActionKeyword.SearchActionKeyword => settings.EnableSearchActionKeyword && + Settings.ActionKeyword.SearchActionKeyword => settings.EnabledSearchActionKeyword && keyword == settings.SearchActionKeyword, Settings.ActionKeyword.PathSearchActionKeyword => settings.EnabledPathSearchKeyword && keyword == settings.PathSearchActionKeyword, diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs index bd6fe7e20..26204616a 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs @@ -21,7 +21,7 @@ namespace Flow.Launcher.Plugin.Explorer public List IndexSearchExcludedSubdirectoryPaths { get; set; } = new List(); public string SearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign; - public bool EnableSearchActionKeyword { get; set; } = true; + public bool EnabledSearchActionKeyword { get; set; } = true; public string FileContentSearchActionKeyword { get; set; } = Constants.DefaultContentSearchActionKeyword; @@ -60,7 +60,7 @@ namespace Flow.Launcher.Plugin.Explorer internal bool? GetActionKeywordEnable(ActionKeyword actionKeyword) => actionKeyword switch { - ActionKeyword.SearchActionKeyword => EnableSearchActionKeyword, + ActionKeyword.SearchActionKeyword => EnabledSearchActionKeyword, ActionKeyword.PathSearchActionKeyword => EnabledPathSearchKeyword, ActionKeyword.IndexSearchActionKeyword => EnabledIndexOnlySearchKeyword, _ => null @@ -68,7 +68,7 @@ namespace Flow.Launcher.Plugin.Explorer internal void SetActionKeywordEnable(ActionKeyword actionKeyword, bool enable) => _ = actionKeyword switch { - ActionKeyword.SearchActionKeyword => EnableSearchActionKeyword = enable, + ActionKeyword.SearchActionKeyword => EnabledSearchActionKeyword = enable, ActionKeyword.PathSearchActionKeyword => EnabledPathSearchKeyword = enable, ActionKeyword.IndexSearchActionKeyword => EnabledIndexOnlySearchKeyword = enable, _ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "Unexpected property")