@@ -13,11 +13,19 @@ public static class ResultManager
13
13
{
14
14
private static PluginInitContext Context ;
15
15
private static Settings Settings { get ; set ; }
16
+ public static object Keyword { get ; private set ; }
16
17
17
18
public static void Init ( PluginInitContext context , Settings settings )
18
19
{
19
20
Context = context ;
20
21
Settings = settings ;
22
+ Keyword = Settings . SearchActionKeywordEnabled ? Settings . SearchActionKeyword : Settings . PathSearchActionKeyword ;
23
+ Keyword = Keyword . ToString ( ) == Query . GlobalPluginWildcardSign ? string . Empty : Keyword + " " ;
24
+ }
25
+
26
+ public static string ChangeToPath ( string path )
27
+ {
28
+ return path . EndsWith ( Constants . DirectorySeperator ) ? path : path + Constants . DirectorySeperator ;
21
29
}
22
30
23
31
internal static Result CreateFolderResult ( string title , string subtitle , string path , Query query , int score = 0 , bool showIndexState = false , bool windowsIndexed = false )
@@ -27,7 +35,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
27
35
Title = title ,
28
36
IcoPath = path ,
29
37
SubTitle = subtitle ,
30
- AutoCompleteText = $ "{ path } \\ ",
38
+ AutoCompleteText = $ "{ Keyword } { ChangeToPath ( path ) } ",
31
39
TitleHighlightData = StringMatcher . FuzzySearch ( query . Search , title ) . MatchData ,
32
40
Action = c =>
33
41
{
@@ -44,13 +52,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
44
52
return false ;
45
53
}
46
54
}
47
- // one of it is enabled
48
- var keyword = Settings . SearchActionKeywordEnabled ? Settings . SearchActionKeyword : Settings . PathSearchActionKeyword ;
49
-
50
- keyword = keyword == Query . GlobalPluginWildcardSign ? string . Empty : keyword + " " ;
51
-
52
- string changeTo = path . EndsWith ( Constants . DirectorySeperator ) ? path : path + Constants . DirectorySeperator ;
53
- Context . API . ChangeQuery ( $ "{ keyword } { changeTo } ") ;
55
+ Context . API . ChangeQuery ( $ "{ Keyword } { ChangeToPath ( path ) } ") ;
54
56
return false ;
55
57
} ,
56
58
Score = score ,
0 commit comments