@@ -21,16 +21,15 @@ public static void Init(PluginInitContext context, Settings settings)
2121 Settings = settings ;
2222 }
2323
24- private static string GetPathWithActionKeyword ( string path , ResultType type )
24+ private static string GetPathWithActionKeyword ( string path , ResultType type , string actionKeyword )
2525 {
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 ;
3028
3129 var formatted_path = path ;
3230
3331 if ( type == ResultType . Folder )
32+ // the seperator is needed so when navigating the folder structure contents of the folder are listed
3433 formatted_path = path . EndsWith ( Constants . DirectorySeperator ) ? path : path + Constants . DirectorySeperator ;
3534
3635 return $ "{ keyword } { formatted_path } ";
@@ -55,7 +54,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
5554 Title = title ,
5655 IcoPath = path ,
5756 SubTitle = Path . GetDirectoryName ( path ) ,
58- AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder ) ,
57+ AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder , query . ActionKeyword ) ,
5958 TitleHighlightData = StringMatcher . FuzzySearch ( query . Search , title ) . MatchData ,
6059 CopyText = path ,
6160 Action = c =>
@@ -74,7 +73,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
7473 }
7574 }
7675
77- Context . API . ChangeQuery ( GetPathWithActionKeyword ( path , ResultType . Folder ) ) ;
76+ Context . API . ChangeQuery ( GetPathWithActionKeyword ( path , ResultType . Folder , query . ActionKeyword ) ) ;
7877
7978 return false ;
8079 } ,
@@ -90,7 +89,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
9089 } ;
9190 }
9291
93- internal static Result CreateDriveSpaceDisplayResult ( string path , bool windowsIndexed = false )
92+ internal static Result CreateDriveSpaceDisplayResult ( string path , string actionKeyword , bool windowsIndexed = false )
9493 {
9594 var progressBarColor = "#26a0da" ;
9695 var title = string . Empty ; // hide title when use progress bar,
@@ -109,7 +108,7 @@ internal static Result CreateDriveSpaceDisplayResult(string path, bool windowsIn
109108 {
110109 Title = title ,
111110 SubTitle = subtitle ,
112- AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder ) ,
111+ AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder , actionKeyword ) ,
113112 IcoPath = path ,
114113 Score = 500 ,
115114 ProgressBar = progressValue ,
@@ -166,7 +165,7 @@ private static string ToReadableSize(long pDrvSize, int pi)
166165 return returnStr ;
167166 }
168167
169- internal static Result CreateOpenCurrentFolderResult ( string path , bool windowsIndexed = false )
168+ internal static Result CreateOpenCurrentFolderResult ( string path , string actionKeyword , bool windowsIndexed = false )
170169 {
171170 var folderName = path . TrimEnd ( Constants . DirectorySeperator ) . Split ( new [ ]
172171 {
@@ -186,7 +185,7 @@ internal static Result CreateOpenCurrentFolderResult(string path, bool windowsIn
186185 Title = title ,
187186 SubTitle = $ "Use > to search within { subtitleFolderName } , " +
188187 $ "* to search for file extensions or >* to combine both searches.",
189- AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder ) ,
188+ AutoCompleteText = GetPathWithActionKeyword ( path , ResultType . Folder , actionKeyword ) ,
190189 IcoPath = path ,
191190 Score = 500 ,
192191 CopyText = path ,
@@ -217,7 +216,7 @@ internal static Result CreateFileResult(string filePath, Query query, int score
217216 SubTitle = Path . GetDirectoryName ( filePath ) ,
218217 IcoPath = filePath ,
219218 Preview = preview ,
220- AutoCompleteText = GetPathWithActionKeyword ( filePath , ResultType . File ) ,
219+ AutoCompleteText = GetPathWithActionKeyword ( filePath , ResultType . File , query . ActionKeyword ) ,
221220 TitleHighlightData = StringMatcher . FuzzySearch ( query . Search , Path . GetFileName ( filePath ) ) . MatchData ,
222221 Score = score ,
223222 CopyText = filePath ,
0 commit comments