summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Moreau <nathan.moreau@m4x.org>2020-04-12 17:52:14 +0200
committerNathan Moreau <nathan.moreau@m4x.org>2020-04-14 22:52:08 +0200
commit7fd78f0f4f0fb5de927e07dd3b115569fce79fb0 (patch)
treed71c7f61654b24753ce3545ca3cf2ba1b51c3367
parent2a8ca9e77b8e1b30c10c0b68da9db7c066e67a0a (diff)
downloadrust-mode-7fd78f0f4f0fb5de927e07dd3b115569fce79fb0.tar.gz
rust-goto-format-problem: make sure to always just to a buffer that exists.
-rw-r--r--rust-mode.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/rust-mode.el b/rust-mode.el
index b6ef25b..9d17cc0 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -1534,7 +1534,7 @@ rustfmt complain in the echo area."
(if (re-search-forward "\nerror:.+\n" nil t)
(buffer-substring p0 (point))
(buffer-substring p0 (point-max)))))))))
- (when (and target-buffer target-point)
+ (when (and target-buffer (get-buffer target-buffer) target-point)
(switch-to-buffer target-buffer)
(goto-char (point-min))
(forward-line (1- (car target-point)))