Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with forward-delete in editable text widget #415

Merged
merged 2 commits into from
Nov 17, 2015

Conversation

krisgiesing
Copy link
Contributor

Fixes index issues when a forward delete is attempted at the end of the text range. Logic now mirrors similar checks done at the beginning of the text range.

@@ -52,7 +52,7 @@ class EditableString implements KeyboardClient {
}

String textAfter(TextRange range) {
return text.substring(range.end);
return text.substring(range.end, text.length);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't that be guaranteed to go past the end?

I thought that's what omitting the argument meant, in fact.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, let me re-examine that change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

End is exclusive, but you're right this is the default behavior. So the change is harmless but irrelevant.

@Hixie
Copy link
Contributor

Hixie commented Nov 17, 2015

LGTM without the textAfter change.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants