Fix off-by-one bug when typing without leading whitespace