summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2016-03-07 15:27:27 -0500
committerNiko Matsakis <niko@alum.mit.edu>2016-03-07 15:27:27 -0500
commit351732107d4073892b752038228072482b6ebdf6 (patch)
tree1e6466edfea4a6ac34ec3c5dd970063e63ec050d
parent6739dd9d6312f231a9a9ed550939994adca271d6 (diff)
parentf408b06ea850e1e0404b3d26335ef73520b55512 (diff)
downloadrust-mode-351732107d4073892b752038228072482b6ebdf6.tar.gz
Merge pull request #129 from MicahChalmer/fix-issue-127
Run the after-revert hook after rustfmt
-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 ()