From f0b7898f8971b89617c66d0716e5ed0627cae2dc Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 22 Dec 2022 22:04:39 +1100 Subject: [PATCH] fix quick access path search and autocomplete text --- .../Search/ResultManager.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index 88bfecc14..6669cbf76 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -49,12 +49,20 @@ namespace Flow.Launcher.Plugin.Explorer.Search internal static Result CreateFolderResult(string title, string subtitle, string path, Query query, int score = 0, bool windowsIndexed = false) { + var pathSearchActionKeyword = Settings.PathSearchKeywordEnabled && !Settings.SearchActionKeywordEnabled + ? Settings.PathSearchActionKeyword + : Settings.SearchActionKeyword == Query.GlobalPluginWildcardSign + ? string.Empty + : Settings.SearchActionKeyword; + return new Result { Title = title, IcoPath = path, SubTitle = Path.GetDirectoryName(path), - AutoCompleteText = GetPathWithActionKeyword(path, ResultType.Folder, query.ActionKeyword), + AutoCompleteText = !Settings.PathSearchKeywordEnabled && !Settings.SearchActionKeywordEnabled + ? $"{query.ActionKeyword} {title}" // Only Quick Access action keyword is used in this scenario + : GetPathWithActionKeyword(path, ResultType.Folder, pathSearchActionKeyword), TitleHighlightData = StringMatcher.FuzzySearch(query.Search, title).MatchData, CopyText = path, Action = c => @@ -73,7 +81,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search } } - Context.API.ChangeQuery(GetPathWithActionKeyword(path, ResultType.Folder, query.ActionKeyword)); + Context.API.ChangeQuery(GetPathWithActionKeyword(path, ResultType.Folder, pathSearchActionKeyword)); return false; },