Skip to content

Commit 7f2757b

Browse files
committed
update isLoadByLiuUniTab when load by cin and json
1 parent 08ea60b commit 7f2757b

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

Packages/ilimi_MainAssembly/Sources/ilimiMainAssembly/IlimiInputController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ extension IlimiInputController {
247247

248248
func commitText(client sender: Any!, text: String) {
249249
// 在快打模式下如果不是最簡碼不會輸出,並且會要求使用重新最簡碼重打
250-
// 快打模式下如果沒有候選字時,可以直接輸出英數
250+
// 快打模式下如果沒有候選字時,可以直接輸出英數
251251
if !isASCIIMode, InputContext.shared.isSpMode, !InputContext.shared.candidates.isEmpty,
252252
!SpModeManager.checkInputIsSp(
253253
text,

Packages/ilimi_MainAssembly/Sources/ilimiMainAssembly/LangModelAssembly/DataInitilizer.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ class DataInitializer {
118118
}
119119
persistenceContainer.saveContext()
120120
userDefaults.set(true, forKey: "hadReadLiuJson")
121+
userDefaults.set(false, forKey: "isLoadByLiuUniTab")
121122
NSLog("liu.json loaded")
122123
}
123124
}

Packages/ilimi_MainAssembly/Sources/ilimiMainAssembly/LangModelAssembly/WordDictReader/CinReader.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class CinReader {
5151
persistenceContainer.saveContext()
5252
// hadReadLiuJson就先不改名成hadReadLiu了...
5353
userDefaults.set(true, forKey: "hadReadLiuJson")
54+
userDefaults.set(false, forKey: "isLoadByLiuUniTab")
5455
NotifierController.notify(message: "自liu.cin讀取\(priority)個字元", stay: true)
5556
} catch {
5657
NSLog(error.localizedDescription)

Packages/ilimi_MainAssembly/Sources/ilimiMainAssembly/Utils/SpMode/SpModeManager.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class SpModeManager {
1919

2020
static func checkInputIsSp(_ text: String, _ assistChar: String) -> Bool {
2121
// 在快打模式下標點符號不一定要是最短碼
22-
if InputContext.shared.isClosure(input: text) {
22+
if InputContext.shared.getCurrentInput().first == "," {
2323
return true
2424
}
2525
let isLoadByLiu = UserDefaults.standard.bool(forKey: "isLoadByLiuUniTab")
@@ -71,7 +71,8 @@ class SpModeManager {
7171
break
7272
}
7373
}
74-
// 如果最短字根只有一個就直接回傳
74+
75+
// 如果最短字根只有一個且是第一位就直接回傳
7576
if shortestKeySet.count == 1 {
7677
return [shortestKeySet.first ?? ""]
7778
}
@@ -122,4 +123,6 @@ class SpModeManager {
122123
}
123124
return []
124125
}
126+
127+
125128
}

0 commit comments

Comments
 (0)