InputState // Add attributedString to .NotEmpty().
This commit is contained in:
parent
ed98a4a7ea
commit
305c919bec
|
@ -118,6 +118,17 @@ class InputState {
|
|||
defer { self.cursorIndex = cursorIndex }
|
||||
}
|
||||
|
||||
var attributedString: NSAttributedString {
|
||||
let attributedString = NSAttributedString(
|
||||
string: composingBuffer,
|
||||
attributes: [
|
||||
.underlineStyle: NSUnderlineStyle.single.rawValue,
|
||||
.markedClauseSegment: 0,
|
||||
]
|
||||
)
|
||||
return attributedString
|
||||
}
|
||||
|
||||
var description: String {
|
||||
"<InputState.NotEmpty, composingBuffer:\(composingBuffer), cursorIndex:\(cursorIndex)>"
|
||||
}
|
||||
|
@ -134,17 +145,6 @@ class InputState {
|
|||
super.init(composingBuffer: composingBuffer, cursorIndex: cursorIndex)
|
||||
}
|
||||
|
||||
var attributedString: NSAttributedString {
|
||||
let attributedString = NSAttributedString(
|
||||
string: composingBuffer,
|
||||
attributes: [
|
||||
.underlineStyle: NSUnderlineStyle.single.rawValue,
|
||||
.markedClauseSegment: 0,
|
||||
]
|
||||
)
|
||||
return attributedString
|
||||
}
|
||||
|
||||
override var description: String {
|
||||
"<InputState.Inputting, composingBuffer:\(composingBuffer), cursorIndex:\(cursorIndex)>, poppedText:\(poppedText)>"
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ class InputState {
|
|||
defer { self.markerIndex = markerIndex }
|
||||
}
|
||||
|
||||
var attributedString: NSAttributedString {
|
||||
override var attributedString: NSAttributedString {
|
||||
let attributedString = NSMutableAttributedString(string: composingBuffer)
|
||||
let end = markedRange.upperBound
|
||||
|
||||
|
@ -327,17 +327,6 @@ class InputState {
|
|||
super.init(composingBuffer: composingBuffer, cursorIndex: cursorIndex)
|
||||
}
|
||||
|
||||
var attributedString: NSAttributedString {
|
||||
let attributedString = NSAttributedString(
|
||||
string: composingBuffer,
|
||||
attributes: [
|
||||
.underlineStyle: NSUnderlineStyle.single.rawValue,
|
||||
.markedClauseSegment: 0,
|
||||
]
|
||||
)
|
||||
return attributedString
|
||||
}
|
||||
|
||||
override var description: String {
|
||||
"<InputState.ChoosingCandidate, candidates:\(candidates), isTypingVertical:\(isTypingVertical), composingBuffer:\(composingBuffer), cursorIndex:\(cursorIndex)>"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue