KeyHandler // Simplify certain if conditions.
This commit is contained in:
parent
dbe54d7a8b
commit
9487a13159
|
@ -137,14 +137,12 @@ class KeyHandler {
|
||||||
/// 估算對象範圍。用比較形象且生動卻有點噁心的解釋的話,蒼蠅一邊吃一邊屙。
|
/// 估算對象範圍。用比較形象且生動卻有點噁心的解釋的話,蒼蠅一邊吃一邊屙。
|
||||||
var popOverflowComposingTextAndWalk: String {
|
var popOverflowComposingTextAndWalk: String {
|
||||||
var textToCommit = ""
|
var textToCommit = ""
|
||||||
if compositor.grid.width > mgrPrefs.composingBufferSize {
|
if compositor.grid.width > mgrPrefs.composingBufferSize, !walkedAnchors.isEmpty {
|
||||||
if !walkedAnchors.isEmpty {
|
let anchor: Megrez.NodeAnchor = walkedAnchors[0]
|
||||||
let anchor: Megrez.NodeAnchor = walkedAnchors[0]
|
if let theNode = anchor.node {
|
||||||
if let theNode = anchor.node {
|
textToCommit = theNode.currentKeyValue.value
|
||||||
textToCommit = theNode.currentKeyValue.value
|
|
||||||
}
|
|
||||||
compositor.removeHeadReadings(count: anchor.spanningLength)
|
|
||||||
}
|
}
|
||||||
|
compositor.removeHeadReadings(count: anchor.spanningLength)
|
||||||
}
|
}
|
||||||
walk()
|
walk()
|
||||||
return textToCommit
|
return textToCommit
|
||||||
|
|
Loading…
Reference in New Issue