Shiki: Fixing how to handle the default candidate keys
Update PreferencesWindowController.swift
This commit is contained in:
parent
7777e96716
commit
35cc98f9cf
|
@ -155,17 +155,13 @@ extension RangeReplaceableCollection where Element: Hashable {
|
||||||
let keys = (sender as AnyObject).stringValue.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).charDeDuplicate
|
let keys = (sender as AnyObject).stringValue.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).charDeDuplicate
|
||||||
if keys.count != 9 || !keys.canBeConverted(to: .ascii) {
|
if keys.count != 9 || !keys.canBeConverted(to: .ascii) {
|
||||||
selectionKeyComboBox.stringValue = Preferences.defaultKeys
|
selectionKeyComboBox.stringValue = Preferences.defaultKeys
|
||||||
Preferences.candidateKeys = nil
|
Preferences.candidateKeys = Preferences.defaultKeys // 修正記錄:這裡千萬不能是 nil,否則會鬼打牆。
|
||||||
NSSound.beep()
|
NSSound.beep()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
selectionKeyComboBox.stringValue = keys
|
selectionKeyComboBox.stringValue = keys
|
||||||
if keys == Preferences.defaultKeys {
|
Preferences.candidateKeys = keys
|
||||||
Preferences.candidateKeys = nil
|
|
||||||
} else {
|
|
||||||
Preferences.candidateKeys = keys
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue