branch: elpa/rust-mode
commit 27911c88b0d32b66429d61bb056ecf1b10e66598
Merge: 6bcb82b a90730f
Author: Tom Tromey <[email protected]>
Commit: GitHub <[email protected]>

    Merge pull request #251 from brotzeit/rust-format-buffer
    
    don't set-window-start for selected window
---
 rust-mode.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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."))

Reply via email to