|
@@ -119,14 +119,14 @@ class KMLanguageViewController: NSViewController,KMLanguageTableCellViewDelegate
|
|
|
return newTokens as! [String]
|
|
|
}
|
|
|
func tokenField(_ tokenField: NSTokenField, completionsForSubstring substring: String, indexOfToken tokenIndex: Int, indexOfSelectedItem selectedIndex: UnsafeMutablePointer<Int>?) -> [Any]? {
|
|
|
- let arrayFilter = self.selectedLanguages.value(forKeyPath: KMGOCRLanguageStringKey) as? [Any]
|
|
|
- let str = String(format: "NOT (SELF in %@)", arrayFilter ?? [])
|
|
|
- let thePredicate = NSPredicate(format: "%@", str)
|
|
|
+ let arrayFilter = self.selectedLanguages.value(forKeyPath: KMGOCRLanguageStringKey) as? NSArray
|
|
|
+// let str = String(format: "NOT (SELF in %@)", arrayFilter ?? "{}")
|
|
|
+ let thePredicate = NSPredicate(format: "NOT (SELF in %@)", arrayFilter ?? [])
|
|
|
let arr: NSArray = self.builtInKeywords! as NSArray
|
|
|
|
|
|
let newBuiltInKeywords: NSArray = arr.filtered(using: thePredicate) as NSArray
|
|
|
- let str1 = String(format: "SELF beginswith[cd] %@", substring)
|
|
|
- let matches = newBuiltInKeywords.filtered(using: NSPredicate(format: "%@", str1))
|
|
|
+// let str1 = String(format: "SELF beginswith[cd] %@", substring)
|
|
|
+ let matches = newBuiltInKeywords.filtered(using: NSPredicate(format: "SELF beginswith[cd] %@", substring))
|
|
|
return matches
|
|
|
}
|
|
|
|