C: Disable undo while uncrustify formats the buffer
parent
49d8dee6d3
commit
497e44386f
|
@ -121,6 +121,7 @@ If the command is not `make', run it normally. "
|
|||
(old-column (current-column))
|
||||
(old-window-start-line (- (line-number-at-pos)
|
||||
(line-number-at-pos (window-start)))))
|
||||
(buffer-disable-undo)
|
||||
(save-mark-and-excursion
|
||||
(delete-region (or start (point-min)) (or end (point-max)))
|
||||
(insert-buffer-substring formatbuf))
|
||||
|
@ -128,7 +129,8 @@ If the command is not `make', run it normally. "
|
|||
(move-to-column old-column)
|
||||
(ignore-errors
|
||||
;; recenter won't work if selected window is not the target buffer.
|
||||
(recenter old-window-start-line)))
|
||||
(recenter old-window-start-line))
|
||||
(buffer-enable-undo))
|
||||
(kill-buffer formatbuf)))
|
||||
;; Return nil if in a `write-file-functions'.
|
||||
nil)
|
||||
|
|
Loading…
Reference in New Issue