mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-08 15:47:43 +00:00
fix issue when trying to paste text while cursor is in a word
This commit is contained in:
parent
6c2a3e8b5f
commit
af3d0535b2
1 changed files with 8 additions and 2 deletions
|
@ -228,8 +228,14 @@ public final class InputLogic {
|
||||||
getActualCapsMode(settingsValues, keyboardShiftMode));
|
getActualCapsMode(settingsValues, keyboardShiftMode));
|
||||||
mConnection.beginBatchEdit();
|
mConnection.beginBatchEdit();
|
||||||
if (mWordComposer.isComposingWord()) {
|
if (mWordComposer.isComposingWord()) {
|
||||||
|
if (mWordComposer.isCursorFrontOrMiddleOfComposingWord()) {
|
||||||
|
// stop composing, otherwise the text will end up at the end of the current word
|
||||||
|
mConnection.finishComposingText();
|
||||||
|
resetComposingState(false);
|
||||||
|
} else {
|
||||||
commitCurrentAutoCorrection(settingsValues, rawText, handler);
|
commitCurrentAutoCorrection(settingsValues, rawText, handler);
|
||||||
addToHistoryIfEmoji(rawText, settingsValues); // add emoji after committing text
|
addToHistoryIfEmoji(rawText, settingsValues); // add emoji after committing text
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
addToHistoryIfEmoji(rawText, settingsValues); // add emoji before resetting, otherwise lastComposedWord is empty
|
addToHistoryIfEmoji(rawText, settingsValues); // add emoji before resetting, otherwise lastComposedWord is empty
|
||||||
resetComposingState(true /* alsoResetLastComposedWord */);
|
resetComposingState(true /* alsoResetLastComposedWord */);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue