Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions rust-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ to the function arguments. When nil, `->' will be indented one level."
:safe #'booleanp
:group 'rust-mode)

(defcustom rust-format-show-buffer nil
(defcustom rust-format-show-buffer t
"Show *rustfmt* buffer if formatting detected problems."
:type 'boolean
:safe #'booleanp
Expand Down Expand Up @@ -1484,6 +1484,8 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
(with-current-buffer (get-buffer rust-rustfmt-buffername)
(goto-char (point-min))
(while (re-search-forward "--> <stdin>:" nil t)
(replace-match (format "--> %s:" buffer-name)))
(while (re-search-forward "--> stdin:" nil t)
(replace-match (format "--> %s:" buffer-name)))))

;; If rust-mode has been configured to navigate to source of the error
Expand Down Expand Up @@ -1532,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)))
Expand Down