fix #7111, tab completion where the first item is ""

~~also use start() instead of 1~~
Also use string indexing functions in common_prefix.