From 4de0bc4b9855a065b0bff88d9ebcfb6756e5051a Mon Sep 17 00:00:00 2001 From: Matus Goljer Date: Wed, 1 Mar 2023 15:28:16 +0100 Subject: [PATCH] feat(fmt): respect terraform-indent-level Fixes #18 --- terraform-mode.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terraform-mode.el b/terraform-mode.el index 2f61684..4793278 100644 --- a/terraform-mode.el +++ b/terraform-mode.el @@ -165,6 +165,8 @@ (window-start (window-start))) (erase-buffer) (insert-buffer-substring buf) + (when (/= terraform-indent-level 2) + (indent-region (point-min) (point-max))) (goto-char point) (set-window-start nil window-start)) (message "terraform fmt: %s" (with-current-buffer buf (buffer-string))))