allow deleting last char

fix #4243