diff options
| author | Tom Tromey <tom@tromey.com> | 2017-12-08 11:15:08 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-08 11:15:08 -0700 |
| commit | 27911c88b0d32b66429d61bb056ecf1b10e66598 (patch) | |
| tree | 95f384f28fc3efc0f5dd96c5a28c51070493487f | |
| parent | 6bcb82b4c2dca4fbbc6585635163bcc5020f6096 (diff) | |
| parent | a90730f12eac21f4cd92319f229cef2a1221d290 (diff) | |
| download | rust-mode-27911c88b0d32b66429d61bb056ecf1b10e66598.tar.gz | |
Merge pull request #251 from brotzeit/rust-format-buffer
don't set-window-start for selected window
| -rw-r--r-- | rust-mode.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rust-mode.el b/rust-mode.el index 82bcc50..6193ebe 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -1478,7 +1478,8 @@ This is written mainly to be used as `end-of-defun-function' for Rust." (buffer (window-buffer window)) (start (rust--format-get-pos buffer (pop loc))) (pos (rust--format-get-pos buffer (pop loc)))) - (set-window-start window start) + (unless (eq buffer current) + (set-window-start window start)) (set-window-point window pos))))) (message "Formatted buffer with rustfmt.")) |
