Skip to content

Commit f0b7898

Browse files
committed
fix quick access path search and autocomplete text
1 parent bade0fc commit f0b7898

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,20 @@ public static Result CreateResult(Query query, SearchResult result)
4949

5050
internal static Result CreateFolderResult(string title, string subtitle, string path, Query query, int score = 0, bool windowsIndexed = false)
5151
{
52+
var pathSearchActionKeyword = Settings.PathSearchKeywordEnabled && !Settings.SearchActionKeywordEnabled
53+
? Settings.PathSearchActionKeyword
54+
: Settings.SearchActionKeyword == Query.GlobalPluginWildcardSign
55+
? string.Empty
56+
: Settings.SearchActionKeyword;
57+
5258
return new Result
5359
{
5460
Title = title,
5561
IcoPath = path,
5662
SubTitle = Path.GetDirectoryName(path),
57-
AutoCompleteText = GetPathWithActionKeyword(path, ResultType.Folder, query.ActionKeyword),
63+
AutoCompleteText = !Settings.PathSearchKeywordEnabled && !Settings.SearchActionKeywordEnabled
64+
? $"{query.ActionKeyword} {title}" // Only Quick Access action keyword is used in this scenario
65+
: GetPathWithActionKeyword(path, ResultType.Folder, pathSearchActionKeyword),
5866
TitleHighlightData = StringMatcher.FuzzySearch(query.Search, title).MatchData,
5967
CopyText = path,
6068
Action = c =>
@@ -73,7 +81,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
7381
}
7482
}
7583

76-
Context.API.ChangeQuery(GetPathWithActionKeyword(path, ResultType.Folder, query.ActionKeyword));
84+
Context.API.ChangeQuery(GetPathWithActionKeyword(path, ResultType.Folder, pathSearchActionKeyword));
7785

7886
return false;
7987
},

0 commit comments

Comments
 (0)