summaryrefslogtreecommitdiff
path: root/rust-mode.el
diff options
context:
space:
mode:
authorMicah Chalmer <micah@micahchalmer.net>2016-03-03 23:44:58 -0500
committerMicah Chalmer <micah@micahchalmer.net>2016-03-03 23:44:58 -0500
commitf408b06ea850e1e0404b3d26335ef73520b55512 (patch)
tree1e6466edfea4a6ac34ec3c5dd970063e63ec050d /rust-mode.el
parent6739dd9d6312f231a9a9ed550939994adca271d6 (diff)
downloadrust-mode-f408b06ea850e1e0404b3d26335ef73520b55512.tar.gz
Run the after-revert hook after rustfmt
Fix #127
Diffstat (limited to 'rust-mode.el')
-rw-r--r--rust-mode.el6
1 files changed, 6 insertions, 0 deletions
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 ()