As suggested by mkcms <k.michal@zoho.com>, but do it in
eglot--apply-text-edits, where it benefits all its users.
Also, just using undo-boundary is not enough, one needs
undo-amalgamate-change-group to mess with the boundaries already in
buffer-undo-list.
* eglot.el (eglot--apply-text-edits): Use
undo-amalgamate-change-group.
GitHub-reference: close https://github.com/joaotavora/eglot/issues/22
(eglot--error "Edits on `%s' require version %d, you have %d"
(current-buffer) version eglot--versioned-identifier))
(atomic-change-group
- (let* ((howmany (length edits))
+ (let* ((change-group (prepare-change-group))
+ (howmany (length edits))
(reporter (make-progress-reporter
(format "[eglot] applying %s edits to `%s'..."
howmany (current-buffer))
(mapcar (eglot--lambda (&key range newText)
(cons newText (eglot--range-region range 'markers)))
edits))
+ (undo-amalgamate-change-group change-group)
(progress-reporter-done reporter))))
(defun eglot--apply-workspace-edit (wedit &optional confirm)