replace is a clumsy way to do this. Instead have setIndent take a string? That'll also satisfy sick people who indent their code with tabs.