mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-20 22:29:10 +00:00
bring back elvis he never hurt nobody
This commit is contained in:
parent
32a21092d3
commit
fed79abe26
1 changed files with 4 additions and 6 deletions
|
@ -117,16 +117,14 @@ class KeyboardActionListenerImpl(private val latinIME: LatinIME, private val inp
|
||||||
var actualSteps = 0
|
var actualSteps = 0
|
||||||
// corrected steps to avoid splitting chars belonging to the same codepoint
|
// corrected steps to avoid splitting chars belonging to the same codepoint
|
||||||
if (steps > 0) {
|
if (steps > 0) {
|
||||||
val text = connection.getSelectedText(0)
|
val text = connection.getSelectedText(0) ?: return steps
|
||||||
if (text == null) actualSteps = steps
|
loopOverCodePoints(text) { cp, charCount ->
|
||||||
else loopOverCodePoints(text) { cp, charCount ->
|
|
||||||
actualSteps += charCount
|
actualSteps += charCount
|
||||||
if (actualSteps >= steps) return actualSteps
|
if (actualSteps >= steps) return actualSteps
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
val text = connection.getTextBeforeCursor(-steps * 4, 0)
|
val text = connection.getTextBeforeCursor(-steps * 4, 0) ?: return steps
|
||||||
if (text == null) actualSteps = steps
|
loopOverCodePointsBackwards(text) { cp, charCount ->
|
||||||
else loopOverCodePointsBackwards(text) { cp, charCount ->
|
|
||||||
actualSteps -= charCount
|
actualSteps -= charCount
|
||||||
if (actualSteps <= steps) return actualSteps
|
if (actualSteps <= steps) return actualSteps
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue