Delete the range of characters from index1 up to but not including index2. If index2 is omitted, the single character at index1 is deleted. The widget always keeps a newline as its last character, so a deletion that would remove it is adjusted accordingly.