branch: elpa/zig-mode commit b4ae21ada29230f7fcba0d32e53466970eff9cc1 Merge: 2c45c45 107a67b Author: Andrea Orru <and...@orru.io> Commit: GitHub <nore...@github.com>
Merge pull request #26 from Saikyun/master 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."