mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-06 14:07:32 +00:00
Merge pull request #463 from keymanapp/ios-fix-spacebar-subkey
Display blank subkey if no text is given
This commit is contained in:
commit
c5ef61c034
1 changed files with 3 additions and 10 deletions
|
|
@ -196,19 +196,12 @@ extension KeymanWebViewController: WKScriptMessageHandler {
|
|||
for key in keyArray {
|
||||
let values = key.components(separatedBy: ":")
|
||||
switch values.count {
|
||||
case 1:
|
||||
subkeyIDs.append(values[0])
|
||||
subkeyTexts.append("")
|
||||
case 2:
|
||||
subkeyIDs.append(values[0])
|
||||
subkeyTexts.append(values[1].stringFromUTF16CodeUnits()!)
|
||||
case 1:
|
||||
subkeyIDs.append(values[0])
|
||||
var text = values[0]
|
||||
if let index = text.index(of: "-") {
|
||||
text = String(text[text.index(after: index)...])
|
||||
}
|
||||
if let index = text.index(of: "_") {
|
||||
text = String(text[text.index(after: index)...])
|
||||
}
|
||||
subkeyTexts.append(text.stringFromUTF16CodeUnits()!)
|
||||
default:
|
||||
Manager.shared.kmLog("Unexpected subkey key: \(key)", checkDebugPrinting: false)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue