fix(format): disengage selection after +format-region

Fix: #7951
This commit is contained in:
Henrik Lissner 2024-07-16 11:34:14 -04:00
parent 3f66400d62
commit 13ed89f235
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -18,6 +18,7 @@
(cur-buffer (current-buffer)) (cur-buffer (current-buffer))
(formatted-buffer (get-buffer-create " *apheleia-formatted*")) (formatted-buffer (get-buffer-create " *apheleia-formatted*"))
(indent 0)) (indent 0))
(unwind-protect
(with-current-buffer formatted-buffer (with-current-buffer formatted-buffer
(erase-buffer) (erase-buffer)
(unless (featurep :system 'windows) (unless (featurep :system 'windows)
@ -55,7 +56,9 @@
(save-excursion (save-excursion
(insert-buffer-substring-no-properties formatted-buffer) (insert-buffer-substring-no-properties formatted-buffer)
(when callback (funcall callback))) (when callback (funcall callback)))
(kill-buffer formatted-buffer))))))) (kill-buffer formatted-buffer)))))
(when (doom-region-active-p)
(setq deactivate-mark t)))))
;; ;;