This issue is about refactoring the `autoIndent.ts` file. Make the code cleaner, more concise and easier to understand. Do not change the actual logic.