[[ Bug 11928 ]] Make sure we reduce endindex by appropriate amount at the appropriate point in settextindex().