File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -121,8 +121,6 @@ Return black process the exit code."
121
121
Show black output, if black exit abnormally and DISPLAY is t."
122
122
(interactive (list t ))
123
123
(let* ((original-buffer (current-buffer ))
124
- (original-point (point ))
125
- (original-window-pos (window-start ))
126
124
(tmpbuf (get-buffer-create " *blacken*" ))
127
125
(errbuf (get-buffer-create " *blacken-error*" )))
128
126
; ; This buffer can be left after previous black invocation. It
@@ -134,10 +132,7 @@ Show black output, if black exit abnormally and DISPLAY is t."
134
132
(if (not (zerop (blacken-call-bin original-buffer tmpbuf errbuf)))
135
133
(error " Black failed, see %s buffer for details " (buffer-name errbuf))
136
134
(unless (eq (compare-buffer-substrings tmpbuf nil nil original-buffer nil nil ) 0 )
137
- (with-current-buffer tmpbuf
138
- (copy-to-buffer original-buffer (point-min ) (point-max )))
139
- (goto-char original-point)
140
- (set-window-start (selected-window ) original-window-pos))
135
+ (with-current-buffer original-buffer (replace-buffer-contents tmpbuf)))
141
136
(mapc 'kill-buffer (list tmpbuf errbuf)))
142
137
(error (message " %s " (error-message-string err))
143
138
(when display
You can’t perform that action at this time.
0 commit comments