editor/format: format by diff & major refactor

This redesigns how format-all applies changes. Before, it would erase
the buffer and insert the formatted result. This would throw markers out
of whack, and usually meant the cursor would end up somewhere else (e.g.
the beginning of the file).

Now, changes are made to the buffer line by line, via RCS patch.

Other changes:

+ +format-region function was removed (replaced by +format-buffer and
  +format/region).
+ set-formatter! was moved to autoload/settings.el
+ New +format/buffer command to replace format-all-buffer
This commit is contained in:
Henrik Lissner 2018-08-29 12:48:38 +02:00
parent cb5c9cc9ea
commit 4b9233bec7
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 266 additions and 193 deletions

View file

@ -3,6 +3,6 @@
;;;###autoload (autoload '+format:region "editor/format/autoload/evil" nil t)
(evil-define-operator +format:region (beg end type)
"Evil ex interface to `+format-region'."
"Evil ex interface to `+format/region'."
(interactive "<R>")
(+format-region beg end))
(+format/region beg end))