editor/format: don't move cursor on save
This commit is contained in:
parent
af045213e3
commit
f1460ff592
2 changed files with 12 additions and 1 deletions
|
@ -217,3 +217,14 @@ is selected)."
|
|||
(if (use-region-p)
|
||||
(+format-region beg end)
|
||||
(format-all-buffer)))
|
||||
|
||||
|
||||
;;
|
||||
;; Hooks
|
||||
;;
|
||||
|
||||
;;;###autoload
|
||||
(defun +format|on-save ()
|
||||
"Runs `format-all-buffer' without moving the cursor."
|
||||
(save-excursion
|
||||
(format-all-buffer)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue