From 576eb40b501213b4707b542b6ab5d13c1538414f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 16 Jul 2020 17:38:43 -0400 Subject: [PATCH] Fix #3555: jinja2-mode reindenting on save --- modules/tools/ansible/config.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/tools/ansible/config.el b/modules/tools/ansible/config.el index d3f9d2740..f98d4b111 100644 --- a/modules/tools/ansible/config.el +++ b/modules/tools/ansible/config.el @@ -17,7 +17,13 @@ (set-evil-initial-state! '(ansible-doc-module-mode) 'emacs)) (use-package! jinja2-mode - :mode "\\.j2$") + :mode "\\.j2$" + :config + ;; The default behavior is to reindent the whole buffer on save. This is + ;; disruptive and imposing. There are indentation commands available; the user + ;; can decide when they want their code reindented. + (add-hook! 'jinja2-mode-hook + (remove-hook 'after-save-hook 'jinja2-indent-buffer t))) (def-project-mode! +ansible-yaml-mode :modes '(yaml-mode)