|
@@ -137,14 +137,15 @@ class KMSearchViewController: NSViewController, NSTextFieldDelegate, NSSearchFie
|
|
|
let searchString = self.searchTextField.stringValue
|
|
|
|
|
|
if searchString != "" {
|
|
|
- if searchs.count == 10 {
|
|
|
- searchs.remove(at: 9)
|
|
|
- }
|
|
|
-
|
|
|
//缓存搜索词汇是否重复
|
|
|
if searchs.contains(searchString) {
|
|
|
searchs.removeObject(searchString)
|
|
|
}
|
|
|
+
|
|
|
+ if searchs.count == 10 {
|
|
|
+ searchs.remove(at: 9)
|
|
|
+ }
|
|
|
+
|
|
|
searchs.insert((self.searchTextField.stringValue), at: 0)
|
|
|
UserDefaults.standard.set(searchs, forKey: CPDFOfficeSearchHistoryKey)
|
|
|
|