@@ -77,54 +77,56 @@ export class Launcher extends search.Search {
77
77
78
78
const pattern = pat . toLowerCase ( )
79
79
80
- const needles = pattern . split ( ' ' ) ;
80
+ if ( pat !== '?' ) {
81
+ const needles = pattern . split ( ' ' ) ;
81
82
82
- const contains_pattern = ( haystack : string , needles : Array < string > ) : boolean => {
83
- const hay = haystack . toLowerCase ( ) ;
84
- return needles . every ( ( n ) => hay . includes ( n ) ) ;
85
- } ;
83
+ const contains_pattern = ( haystack : string , needles : Array < string > ) : boolean => {
84
+ const hay = haystack . toLowerCase ( ) ;
85
+ return needles . every ( ( n ) => hay . includes ( n ) ) ;
86
+ } ;
86
87
87
- // Filter matching windows
88
- for ( const window of ext . tab_list ( Meta . TabList . NORMAL , null ) ) {
89
- const retain = contains_pattern ( window . name ( ext ) , needles )
90
- || contains_pattern ( window . meta . get_title ( ) , needles ) ;
88
+ // Filter matching windows
89
+ for ( const window of ext . tab_list ( Meta . TabList . NORMAL , null ) ) {
90
+ const retain = contains_pattern ( window . name ( ext ) , needles )
91
+ || contains_pattern ( window . meta . get_title ( ) , needles ) ;
91
92
92
- if ( retain ) {
93
- windows . push ( window_selection ( ext , window , this . icon_size ( ) ) )
93
+ if ( retain ) {
94
+ windows . push ( window_selection ( ext , window , this . icon_size ( ) ) )
95
+ }
94
96
}
95
- }
96
-
97
- // Filter matching desktop apps
98
- for ( const [ where , app ] of this . desktop_apps ) {
99
- const name = app . name ( )
100
- const keywords = app . keywords ( )
101
- const exec = app . exec ( )
102
-
103
- let app_items = name . split ( ' ' )
104
- if ( keywords !== null ) app_items = app_items . concat ( keywords )
105
- if ( exec !== null ) app_items = app_items . concat ( exec )
106
-
107
- for ( const item of app_items ) {
108
- const item_match = item . toLowerCase ( )
109
- if ( item_match . startsWith ( pattern )
110
- || item_match . includes ( pattern )
111
- || levenshtein . compare ( item_match , pattern ) < 3 ) {
112
- const generic = app . generic_name ( ) ;
113
- const button = new launch . SearchOption (
114
- name ,
115
- generic ? generic + " — " + where : where ,
116
- 'new-window-symbolic' ,
117
- { gicon : app . icon ( ) } ,
118
- this . icon_size ( ) ,
119
- { app } ,
120
- exec ,
121
- keywords
122
- )
123
-
124
- DedicatedGPU . addPopup ( app , button . widget )
125
97
126
- this . options . push ( button )
127
- break
98
+ // Filter matching desktop apps
99
+ for ( const [ where , app ] of this . desktop_apps ) {
100
+ const name = app . name ( )
101
+ const keywords = app . keywords ( )
102
+ const exec = app . exec ( )
103
+
104
+ let app_items = name . split ( ' ' )
105
+ if ( keywords !== null ) app_items = app_items . concat ( keywords )
106
+ if ( exec !== null ) app_items = app_items . concat ( exec )
107
+
108
+ for ( const item of app_items ) {
109
+ const item_match = item . toLowerCase ( )
110
+ if ( item_match . startsWith ( pattern )
111
+ || item_match . includes ( pattern )
112
+ || levenshtein . compare ( item_match , pattern ) < 3 ) {
113
+ const generic = app . generic_name ( ) ;
114
+ const button = new launch . SearchOption (
115
+ name ,
116
+ generic ? generic + " — " + where : where ,
117
+ 'new-window-symbolic' ,
118
+ { gicon : app . icon ( ) } ,
119
+ this . icon_size ( ) ,
120
+ { app } ,
121
+ exec ,
122
+ keywords
123
+ )
124
+
125
+ DedicatedGPU . addPopup ( app , button . widget )
126
+
127
+ this . options . push ( button )
128
+ break
129
+ }
128
130
}
129
131
}
130
132
}
0 commit comments