File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,8 @@ extension AppListModel {
223
223
224
224
for app in apps {
225
225
var key = app. name
226
+ . trimmingCharacters ( in: . controlCharacters)
227
+ . trimmingCharacters ( in: . whitespacesAndNewlines)
226
228
. applyingTransform ( . stripCombiningMarks, reverse: false ) ?
227
229
. applyingTransform ( . toLatin, reverse: false ) ?
228
230
. applyingTransform ( . stripDiacritics, reverse: false ) ?
@@ -243,7 +245,17 @@ extension AppListModel {
243
245
groupedApps [ key] ? . append ( app)
244
246
}
245
247
246
- groupedApps. sort { $0. key < $1. key }
248
+ groupedApps. sort { app1, app2 in
249
+ if let c1 = app1. key. first,
250
+ let c2 = app2. key. first,
251
+ let idx1 = allowedCharacters. firstIndex ( of: c1) ,
252
+ let idx2 = allowedCharacters. firstIndex ( of: c2)
253
+ {
254
+ return idx1 < idx2
255
+ }
256
+ return app1. key < app2. key
257
+ }
258
+
247
259
return groupedApps
248
260
}
249
261
}
You can’t perform that action at this time.
0 commit comments