auto-indent: use a copied iter to avoid mutation