Rewrite join_select_spaces

Stop using regex for selecting spaces at the begining of the line
shell_completion uses command completion after semicolons