branch: elpa/rust-mode
commit 351732107d4073892b752038228072482b6ebdf6
Merge: 6739dd9 f408b06
Author: Niko Matsakis <[email protected]>
Commit: Niko Matsakis <[email protected]>
Merge pull request #129 from MicahChalmer/fix-issue-127
Run the after-revert hook after rustfmt
---
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 ()