fixes infinite loop when deleting input that only contains whitespace using deleteWordLeft() fixes index out of range panic when deleting input that only contains whitespace using deleteWordRight()