Skip to content

Commit 3517321

Browse files
committed
Merge pull request #129 from MicahChalmer/fix-issue-127
Run the after-revert hook after rustfmt
2 parents 6739dd9 + f408b06 commit 3517321

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rust-mode.el

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,12 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
12471247
(rust--format-call (current-buffer))
12481248
(goto-char cur-point)
12491249
(set-window-start (selected-window) cur-win-start))
1250+
1251+
;; Issue #127: Running this on a buffer acts like a revert, and could cause
1252+
;; the fontification to get out of sync. Call the same hook to ensure it is
1253+
;; restored.
1254+
(rust--after-revert-hook)
1255+
12501256
(message "Formatted buffer with rustfmt."))
12511257

12521258
(defun rust-enable-format-on-save ()

0 commit comments

Comments
 (0)