diff --git a/Source/Modules/SessionCtl_HandleDisplay.swift b/Source/Modules/SessionCtl_HandleDisplay.swift index 590e41a2..132c8b2f 100644 --- a/Source/Modules/SessionCtl_HandleDisplay.swift +++ b/Source/Modules/SessionCtl_HandleDisplay.swift @@ -18,8 +18,8 @@ public extension SessionCtl { // 這樣,不但強制使用(限制讀音 20 個的)浮動組字窗,而且內文組字區只會顯示一個空格。 var attributedStringSecured: (value: NSAttributedString, range: NSRange) { clientMitigationLevel >= 2 - ? (state.data.attributedStringPlaceholder, NSRange(location: 0, length: 0)) - : (state.attributedString, NSRange(state.u16MarkedRange)) + ? (state.data.attributedStringPlaceholder(for: self), NSRange(location: 0, length: 0)) + : (state.attributedString(for: self), NSRange(state.u16MarkedRange)) } func lineHeightRect(zeroCursor: Bool = false) -> NSRect { diff --git a/Source/Modules/SessionCtl_HandleStates.swift b/Source/Modules/SessionCtl_HandleStates.swift index f1864558..818fff4b 100644 --- a/Source/Modules/SessionCtl_HandleStates.swift +++ b/Source/Modules/SessionCtl_HandleStates.swift @@ -109,11 +109,11 @@ public extension SessionCtl { mitigation: if clientMitigationLevel == 1, state.type == .ofMarking { if !PrefMgr.shared.disableSegmentedThickUnderlineInMarkingModeForManagedClients { break mitigation } let neo = NSMutableAttributedString(attributedString: attributedStringSecured.value) + let rangeNeo = NSRange(location: 0, length: neo.string.utf16.count) neo.setAttributes( - [ - .underlineStyle: NSUnderlineStyle.thick.rawValue, - .markedClauseSegment: 0, - ], range: NSRange(location: 0, length: neo.string.utf16.count) + mark(forStyle: kTSMHiliteSelectedConvertedText, at: rangeNeo) + as? [NSAttributedString.Key: Any] + ?? [.underlineStyle: NSUnderlineStyle.thick.rawValue], range: rangeNeo ) attrStr = neo theRange = NSRange.zero