emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/zig-mode 107a67b 060/104: Runs `revert-buffer` after forma


From: ELPA Syncer
Subject: [nongnu] elpa/zig-mode 107a67b 060/104: Runs `revert-buffer` after formatting on save.
Date: Sun, 29 Aug 2021 11:37:03 -0400 (EDT)

branch: elpa/zig-mode
commit 107a67b3773fd757de9b0136c204b32dfe6bb4b6
Author: Jona Ekenberg <saikyun@gmail.com>
Commit: Jona Ekenberg <saikyun@gmail.com>

    Runs `revert-buffer` after formatting on save.
---
 zig-mode.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/zig-mode.el b/zig-mode.el
index d4c0590..69927c7 100644
--- a/zig-mode.el
+++ b/zig-mode.el
@@ -122,9 +122,11 @@ If given a SOURCE, execute the CMD on it."
                                          "fmt"
                                          (buffer-file-name))
           (lambda (process _e)
-                (when (> (process-exit-status process) 0)
-                  (switch-to-buffer-other-window fmt-buffer)
-                  (compilation-mode)))))))
+                (if (> (process-exit-status process) 0)
+                    (progn
+                        (switch-to-buffer-other-window fmt-buffer)
+                        (compilation-mode))
+                  (revert-buffer :ignore-auto :noconfirm)))))))
 
 (defun zig-re-word (inner)
   "Construct a regular expression for the word INNER."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]