check whether range count greater than 0

temporarily fix #192. Because Caret.js can't get the range at the
beginning of the text field too.