branch: elpa/zig-mode commit 107a67b3773fd757de9b0136c204b32dfe6bb4b6 Author: Jona Ekenberg <saik...@gmail.com> Commit: Jona Ekenberg <saik...@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."