tweak(format): +format/region: emit message on success
This commit is contained in:
parent
67e5dda526
commit
abf19aa63e
1 changed files with 10 additions and 3 deletions
|
@ -68,14 +68,21 @@
|
||||||
(defalias '+format/buffer #'apheleia-format-buffer)
|
(defalias '+format/buffer #'apheleia-format-buffer)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +format/region (beg end &optional _arg)
|
(defun +format/region (beg end &optional _arg interactive)
|
||||||
"Format the selected region.
|
"Format the selected region.
|
||||||
|
|
||||||
WARNING: if the formatter doesn't support partial formatting, this command tries
|
WARNING: if the formatter doesn't support partial formatting, this command tries
|
||||||
to pretend the active selection is the contents of a standalone file, but this
|
to pretend the active selection is the contents of a standalone file, but this
|
||||||
may not always work. Keep your undo keybind handy!"
|
may not always work. Keep your undo keybind handy!"
|
||||||
(interactive "rP")
|
(interactive (list (doom-region-beginning)
|
||||||
(+format-region beg end))
|
(doom-region-end)
|
||||||
|
current-prefix-arg
|
||||||
|
'interactive))
|
||||||
|
(+format-region
|
||||||
|
beg end
|
||||||
|
(lambda ()
|
||||||
|
(when interactive
|
||||||
|
(message "Region reformatted!")))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +format/region-or-buffer ()
|
(defun +format/region-or-buffer ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue