File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Plugins/Flow.Launcher.Plugin.Sys Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,23 @@ public List<Result> Query(Query query)
7878 c . Title = command . Name ;
7979 c . SubTitle = command . Description ;
8080
81- var score = _context . API . FuzzySearch ( query . Search , command . Keyword ) . Score ;
81+ // Firstly, we will search the localized title & subtitle
82+ var titleMatch = _context . API . FuzzySearch ( query . Search , c . Title ) ;
83+ var subTitleMatch = _context . API . FuzzySearch ( query . Search , c . SubTitle ) ;
84+
85+ var score = Math . Max ( titleMatch . Score , subTitleMatch . Score ) ;
86+ if ( score > 0 )
87+ {
88+ c . Score = score ;
89+
90+ if ( score == titleMatch . Score )
91+ c . TitleHighlightData = titleMatch . MatchData ;
92+
93+ results . Add ( c ) ;
94+ }
95+
96+ // If no match found, we will search the keyword
97+ score = _context . API . FuzzySearch ( query . Search , command . Keyword ) . Score ;
8298 if ( score > 0 )
8399 {
84100 c . Score = score ;
You can’t perform that action at this time.
0 commit comments