File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 86
86
; ; Since we run rustfmt through stdin we get <stdin> markers in the
87
87
; ; output. This replaces them with the buffer name instead.
88
88
(defun rust--format-fix-rustfmt-buffer (buffer-name )
89
- (with-current-buffer ( get-buffer rust-rustfmt-buffername)
90
- (let (( inhibit-read-only t ) )
91
- (goto-char ( point-min ) )
92
- ( while ( re-search-forward " --> <stdin> :" nil t )
93
- ( replace-match ( format " --> %s : " buffer-name) ))
94
- (while (re-search-forward " --> stdin:" nil t )
95
- ( replace-match ( format " --> %s : " buffer-name ))))))
89
+ (save-match-data
90
+ (with-current-buffer ( get-buffer rust-rustfmt-buffername )
91
+ (let (( inhibit-read-only t )
92
+ ( fixed ( format " --> %s : " buffer-name)) )
93
+ ( goto-char ( point-min ))
94
+ (while (re-search-forward " --> \\ (?:< stdin> \\ |stdin \\ ) :" nil t )
95
+ ( replace-match fixed ))))))
96
96
97
97
; ; If rust-mode has been configured to navigate to source of the error
98
98
; ; or display it, do so -- and return true. Otherwise return nil to
You can’t perform that action at this time.
0 commit comments