@@ -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
var folderName = path . TrimEnd ( Constants . DirectorySeperator ) . Split ( new [ ]
172
171
{
@@ -186,7 +185,7 @@ internal static Result CreateOpenCurrentFolderResult(string path, bool windowsIn
186
185
Title = title ,
187
186
SubTitle = $ "Use > to search within { subtitleFolderName } , " +
188
187
$ "* to search for file extensions or >* to combine both searches.",
189
- AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder ) ,
188
+ AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder , actionKeyword ) ,
190
189
IcoPath = path ,
191
190
Score = 500 ,
192
191
CopyText = path ,
@@ -217,7 +216,7 @@ internal static Result CreateFileResult(string filePath, Query query, int score
217
216
SubTitle = Path . GetDirectoryName ( filePath ) ,
218
217
IcoPath = filePath ,
219
218
Preview = preview ,
220
- AutoCompleteText = GetPathWithActionKeyword ( filePath , ResultType . File ) ,
219
+ AutoCompleteText = GetPathWithActionKeyword ( filePath , ResultType . File , query . ActionKeyword ) ,
221
220
TitleHighlightData = StringMatcher . FuzzySearch ( query . Search , Path . GetFileName ( filePath ) ) . MatchData ,
222
221
Score = score ,
223
222
CopyText = filePath ,
0 commit comments