ensure autoindent is restored correctly