branch: elpa/rust-mode
commit f408b06ea850e1e0404b3d26335ef73520b55512
Author: Micah Chalmer <[email protected]>
Commit: Micah Chalmer <[email protected]>
Run the after-revert hook after rustfmt
Fix #127
---
rust-mode.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/rust-mode.el b/rust-mode.el
index 56b356d..56657d6 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -1247,6 +1247,12 @@ This is written mainly to be used as
`end-of-defun-function' for Rust."
(rust--format-call (current-buffer))
(goto-char cur-point)
(set-window-start (selected-window) cur-win-start))
+
+ ;; Issue #127: Running this on a buffer acts like a revert, and could cause
+ ;; the fontification to get out of sync. Call the same hook to ensure it is
+ ;; restored.
+ (rust--after-revert-hook)
+
(message "Formatted buffer with rustfmt."))
(defun rust-enable-format-on-save ()