Implement most of the features of TextField

What if `endIndex` is `plainText.length - 1`?