@@ -21,16 +21,15 @@ 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 )
24
+ private static string GetPathWithActionKeyword ( string path , ResultType type , string actionKeyword )
25
25
{
26
- // one of it is enabled
27
- var keyword = Settings . SearchActionKeywordEnabled ? Settings . SearchActionKeyword : Settings . PathSearchActionKeyword ;
28
-
29
- keyword = keyword == Query . GlobalPluginWildcardSign ? string . Empty : keyword + " " ;
26
+ // Query.ActionKeyword is string.Empty when Global Action Keyword ('*') is used
27
+ var keyword = actionKeyword != string . Empty ? actionKeyword + " " : string . Empty ;
30
28
31
29
var formatted_path = path ;
32
30
33
31
if ( type == ResultType . Folder )
32
+ // the seperator is needed so when navigating the folder structure contents of the folder are listed
34
33
formatted_path = path . EndsWith ( Constants . DirectorySeperator ) ? path : path + Constants . DirectorySeperator ;
35
34
36
35
return $ "{ keyword } { formatted_path } ";
@@ -55,7 +54,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
55
54
Title = title ,
56
55
IcoPath = path ,
57
56
SubTitle = Path . GetDirectoryName ( path ) ,
58
- AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder ) ,
57
+ AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder , query . ActionKeyword ) ,
59
58
TitleHighlightData = StringMatcher . FuzzySearch ( query . Search , title ) . MatchData ,
60
59
CopyText = path ,
61
60
Action = c =>
@@ -74,7 +73,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
74
73
}
75
74
}
76
75
77
- Context . API . ChangeQuery ( GetPathWithActionKeyword ( path , ResultType . Folder ) ) ;
76
+ Context . API . ChangeQuery ( GetPathWithActionKeyword ( path , ResultType . Folder , query . ActionKeyword ) ) ;
78
77
79
78
return false ;
80
79
} ,
@@ -90,7 +89,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
90
89
} ;
91
90
}
92
91
93
- internal static Result CreateDriveSpaceDisplayResult ( string path , bool windowsIndexed = false )
92
+ internal static Result CreateDriveSpaceDisplayResult ( string path , string actionKeyword , bool windowsIndexed = false )
94
93
{
95
94
var progressBarColor = "#26a0da" ;
96
95
var title = string . Empty ; // hide title when use progress bar,
@@ -109,7 +108,7 @@ internal static Result CreateDriveSpaceDisplayResult(string path, bool windowsIn
109
108
{
110
109
Title = title ,
111
110
SubTitle = subtitle ,
112
- AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder ) ,
111
+ AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder , actionKeyword ) ,
113
112
IcoPath = path ,
114
113
Score = 500 ,
115
114
ProgressBar = progressValue ,
@@ -166,7 +165,7 @@ private static string ToReadableSize(long pDrvSize, int pi)
166
165
return returnStr ;
167
166
}
168
167
169
- internal static Result CreateOpenCurrentFolderResult ( string path , bool windowsIndexed = false )
168
+ internal static Result CreateOpenCurrentFolderResult ( string path , string actionKeyword , bool windowsIndexed = false )
170
169
{
171
170
// Path passed from PathSearchAsync ends with Constants.DirectorySeperator ('\'), need to remove the seperator
172
171
// so it's consistent with folder results returned by index search which does not end with one
@@ -190,7 +189,7 @@ internal static Result CreateOpenCurrentFolderResult(string path, bool windowsIn
190
189
Title = title ,
191
190
SubTitle = $ "Use > to search within { subtitleFolderName } , " +
192
191
$ "* to search for file extensions or >* to combine both searches.",
193
- AutoCompleteText = GetPathWithActionKeyword ( folderPath , ResultType . Folder ) ,
192
+ AutoCompleteText = GetPathWithActionKeyword ( folderPath , ResultType . Folder , actionKeyword ) ,
194
193
IcoPath = folderPath ,
195
194
Score = 500 ,
196
195
CopyText = folderPath ,
@@ -221,7 +220,7 @@ internal static Result CreateFileResult(string filePath, Query query, int score
221
220
SubTitle = Path . GetDirectoryName ( filePath ) ,
222
221
IcoPath = filePath ,
223
222
Preview = preview ,
224
- AutoCompleteText = GetPathWithActionKeyword ( filePath , ResultType . File ) ,
223
+ AutoCompleteText = GetPathWithActionKeyword ( filePath , ResultType . File , query . ActionKeyword ) ,
225
224
TitleHighlightData = StringMatcher . FuzzySearch ( query . Search , Path . GetFileName ( filePath ) ) . MatchData ,
226
225
Score = score ,
227
226
CopyText = filePath ,
0 commit comments