Title: Spans strange behavior
Tags: android;textview;android-edittext;android-spannable
Question: Prerequisite
I've create a simple project with an EditText and a string "Hello World!" inside. The EditText has a StyleSpan(Typeface.BOLD) applied to it using editText.editableText.setSpan(span, 6, 11, Spannable.SPAN_INCLUSIVE_EXCLUSIVE).
The problem
As you can see from the gif above, when the space between the words "Hello" and "World" is removed, and the ending letters of the new merged word start being deleted, the whole word gets spanned. Does anybody have any ideas what might be causing them to behave this way?
A link to the repository where you can get more details



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2020:00:06/02/20', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<android><textview><android-edittext><android-spannable>', 'Title': 'Spans strange behavior', 'ViewCount': 48, 'id': 62146781, 'user_AboutMe': '', 'user_AccountId': 9731589.0, 'user_DisplayName': 'Stanislav Shamilov', 'user_Reputation': 1628.0, 'user_Views': 110.0, 'user_id': 7216441.0}}