diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt b/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt index a326e684a..c84284aad 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt @@ -1238,6 +1238,12 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown } if (length() != 0) { + // do not set selection when we try to select end of buffer marker in empty editor + if (selStart == 0 && selEnd == 1 && (length() == 1 && text[0] == Constants.END_OF_BUFFER_MARKER)) { + deleteInlineStyleFromTheBeginning() + return + } + // if the text end has the marker, let's make sure the cursor never includes it or surpasses it if ((selStart == length() || selEnd == length()) && text[length() - 1] == Constants.END_OF_BUFFER_MARKER) { var start = selStart