Skip to content

Commit

Permalink
送り仮名つきの辞書登録完了時に確定する文字列に送り仮名がついてなかったバグを修正 (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtgto committed Mar 8, 2024
1 parent bfe47f5 commit 7e4c3cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion macSKK/StateMachine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ class StateMachine {
addWordToUserDict(yomi: registerState.yomi, okuri: registerState.okuri, candidate: Candidate(registerState.text))
state.specialState = nil
state.inputMode = registerState.prev.mode
addFixedText(registerState.text)
if let okuri = registerState.okuri {
addFixedText(registerState.text + okuri)
} else {
addFixedText(registerState.text)
}
}
return true
} else if case .unregister(let unregisterState) = specialState {
Expand Down
2 changes: 1 addition & 1 deletion macSKKTests/StateMachineTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,7 @@ final class StateMachineTests: XCTestCase {
XCTAssertEqual(events[2], .modeChanged(.hiragana, .zero))
XCTAssertEqual(events[3], .markedText(MarkedText([.plain("[登録:あ*け]")])))
XCTAssertEqual(events[4], .markedText(MarkedText([.plain("[登録:あ*け]"), .plain("")])))
XCTAssertEqual(events[5], .fixedText(""))
XCTAssertEqual(events[5], .fixedText("いけ"), "辞書登録後は単語登録時に使用した送り仮名つきで確定する")
expectation.fulfill()
}.store(in: &cancellables)
XCTAssertTrue(stateMachine.handle(printableKeyEventAction(character: "a", withShift: true)))
Expand Down

0 comments on commit 7e4c3cc

Please sign in to comment.