Shiki: Fixing how to handle the default candidate keys

Update PreferencesWindowController.swift
This commit is contained in:
ShikiSuen 2022-01-16 14:14:10 +08:00
parent 7777e96716
commit 35cc98f9cf
1 changed files with 2 additions and 6 deletions

View File

@ -155,17 +155,13 @@ extension RangeReplaceableCollection where Element: Hashable {
let keys = (sender as AnyObject).stringValue.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).charDeDuplicate
if keys.count != 9 || !keys.canBeConverted(to: .ascii) {
selectionKeyComboBox.stringValue = Preferences.defaultKeys
Preferences.candidateKeys = nil
Preferences.candidateKeys = Preferences.defaultKeys // nil
NSSound.beep()
return
}
selectionKeyComboBox.stringValue = keys
if keys == Preferences.defaultKeys {
Preferences.candidateKeys = nil
} else {
Preferences.candidateKeys = keys
}
Preferences.candidateKeys = keys
}
}