KeyHandler // Simplify certain if conditions.

This commit is contained in:
ShikiSuen 2022-06-29 12:45:53 +08:00
parent dbe54d7a8b
commit 9487a13159
1 changed files with 5 additions and 7 deletions

View File

@ -137,14 +137,12 @@ class KeyHandler {
///
var popOverflowComposingTextAndWalk: String {
var textToCommit = ""
if compositor.grid.width > mgrPrefs.composingBufferSize {
if !walkedAnchors.isEmpty {
let anchor: Megrez.NodeAnchor = walkedAnchors[0]
if let theNode = anchor.node {
textToCommit = theNode.currentKeyValue.value
}
compositor.removeHeadReadings(count: anchor.spanningLength)
if compositor.grid.width > mgrPrefs.composingBufferSize, !walkedAnchors.isEmpty {
let anchor: Megrez.NodeAnchor = walkedAnchors[0]
if let theNode = anchor.node {
textToCommit = theNode.currentKeyValue.value
}
compositor.removeHeadReadings(count: anchor.spanningLength)
}
walk()
return textToCommit