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