Slightly smarter TAB autocompletion

Tab autocompletion not breaking regular tab for many cases (including multiline tab where the lines included any character that triggered autocompletion)