change spaces to tabs
only use setSelectionRange if supported

fixes #75