Fix for busted tab completions in for loop arguments, switch statements,
and other syntactic constructs. Fixes #1309