@@ -21,10 +21,13 @@ public static void Init(PluginInitContext context, Settings settings)
21
21
Settings = settings ;
22
22
}
23
23
24
- private static string GetPathWithActionKeyword ( string path , ResultType type , string actionKeyword )
24
+ private static string GetPathWithActionKeyword ( string path , ResultType type )
25
25
{
26
- // Query.ActionKeyword is string.Empty when Global Action Keyword ('*') is used
27
- var keyword = actionKeyword != string . Empty ? actionKeyword + " " : string . Empty ;
26
+ var keyword = Settings . PathSearchKeywordEnabled && ! Settings . SearchActionKeywordEnabled
27
+ ? $ "{ Settings . PathSearchActionKeyword } "
28
+ : Settings . SearchActionKeyword == Query . GlobalPluginWildcardSign
29
+ ? string . Empty // Query.ActionKeyword is string.Empty when Global Action Keyword ('*') is used
30
+ : $ "{ Settings . SearchActionKeyword } ";
28
31
29
32
var formatted_path = path ;
30
33
@@ -49,20 +52,14 @@ public static Result CreateResult(Query query, SearchResult result)
49
52
50
53
internal static Result CreateFolderResult ( string title , string subtitle , string path , Query query , int score = 0 , bool windowsIndexed = false )
51
54
{
52
- var pathSearchActionKeyword = Settings . PathSearchKeywordEnabled && ! Settings . SearchActionKeywordEnabled
53
- ? Settings . PathSearchActionKeyword
54
- : Settings . SearchActionKeyword == Query . GlobalPluginWildcardSign
55
- ? string . Empty
56
- : Settings . SearchActionKeyword ;
57
-
58
55
return new Result
59
56
{
60
57
Title = title ,
61
58
IcoPath = path ,
62
59
SubTitle = Path . GetDirectoryName ( path ) ,
63
60
AutoCompleteText = ! Settings . PathSearchKeywordEnabled && ! Settings . SearchActionKeywordEnabled
64
61
? $ "{ query . ActionKeyword } { title } " // Only Quick Access action keyword is used in this scenario
65
- : GetPathWithActionKeyword ( path , ResultType . Folder , pathSearchActionKeyword ) ,
62
+ : GetPathWithActionKeyword ( path , ResultType . Folder ) ,
66
63
TitleHighlightData = StringMatcher . FuzzySearch ( query . Search , title ) . MatchData ,
67
64
CopyText = path ,
68
65
Action = c =>
@@ -81,7 +78,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
81
78
}
82
79
}
83
80
84
- Context . API . ChangeQuery ( GetPathWithActionKeyword ( path , ResultType . Folder , pathSearchActionKeyword ) ) ;
81
+ Context . API . ChangeQuery ( GetPathWithActionKeyword ( path , ResultType . Folder ) ) ;
85
82
86
83
return false ;
87
84
} ,
@@ -116,7 +113,7 @@ internal static Result CreateDriveSpaceDisplayResult(string path, string actionK
116
113
{
117
114
Title = title ,
118
115
SubTitle = subtitle ,
119
- AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder , actionKeyword ) ,
116
+ AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder ) ,
120
117
IcoPath = path ,
121
118
Score = 500 ,
122
119
ProgressBar = progressValue ,
@@ -197,7 +194,7 @@ internal static Result CreateOpenCurrentFolderResult(string path, string actionK
197
194
Title = title ,
198
195
SubTitle = $ "Use > to search within { subtitleFolderName } , " +
199
196
$ "* to search for file extensions or >* to combine both searches.",
200
- AutoCompleteText = GetPathWithActionKeyword ( folderPath , ResultType . Folder , actionKeyword ) ,
197
+ AutoCompleteText = GetPathWithActionKeyword ( folderPath , ResultType . Folder ) ,
201
198
IcoPath = folderPath ,
202
199
Score = 500 ,
203
200
CopyText = folderPath ,
@@ -228,7 +225,7 @@ internal static Result CreateFileResult(string filePath, Query query, int score
228
225
SubTitle = Path . GetDirectoryName ( filePath ) ,
229
226
IcoPath = filePath ,
230
227
Preview = preview ,
231
- AutoCompleteText = GetPathWithActionKeyword ( filePath , ResultType . File , query . ActionKeyword ) ,
228
+ AutoCompleteText = GetPathWithActionKeyword ( filePath , ResultType . File ) ,
232
229
TitleHighlightData = StringMatcher . FuzzySearch ( query . Search , Path . GetFileName ( filePath ) ) . MatchData ,
233
230
Score = score ,
234
231
CopyText = filePath ,
0 commit comments