From e8a9377ec48a6246563f3a8925fd8b1504c18188 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Fri, 2 Jul 2021 11:46:10 +0800 Subject: [PATCH] fix up logic --- .../Search/ResultManager.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index 004e57cfb..76736466f 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) + if (c.SpecialKeyState.CtrlPressed || !(Settings.EnabledPathSearchKeyword || Settings.EnableSearchActionKeyword)) { try { @@ -41,11 +41,13 @@ namespace Flow.Launcher.Plugin.Explorer.Search return false; } } + // one of it is enabled + var keyword = Settings.EnableSearchActionKeyword ? Settings.SearchActionKeyword : Settings.PathSearchActionKeyword; + + keyword = keyword == "*" ? "" : $"{keyword} "; string changeTo = path.EndsWith(Constants.DirectorySeperator) ? path : path + Constants.DirectorySeperator; - Context.API.ChangeQuery(Settings.PathSearchActionKeyword == "*" ? - changeTo : - $"{Settings.PathSearchActionKeyword} {changeTo}"); + Context.API.ChangeQuery($"{keyword}{changeTo}"); return false; }, Score = score,