Implement selection ranges and deletion of \n for TextInput.