[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 48c3f45 10/12: Close #22: Apply text edits as a s
From: |
João Távora |
Subject: |
[elpa] externals/eglot 48c3f45 10/12: Close #22: Apply text edits as a single undoable edit |
Date: |
Fri, 22 Jun 2018 11:52:17 -0400 (EDT) |
branch: externals/eglot
commit 48c3f455cf15ad9025821ca227885fcc826c6d54
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Close #22: Apply text edits as a single undoable edit
As suggested by mkcms <address@hidden>, 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.
---
eglot.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/eglot.el b/eglot.el
index 9e686ee..2fdf433 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1584,7 +1584,8 @@ If SKIP-SIGNATURE, don't try to send
textDocument/signatureHelp."
(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))
@@ -1604,6 +1605,7 @@ If SKIP-SIGNATURE, don't try to send
textDocument/signatureHelp."
(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)
- [elpa] externals/eglot updated (a1f1dd6 -> 0176264), João Távora, 2018/06/22
- [elpa] externals/eglot 04ef055 11/12: Close #27: empty ranges are valid in LSP, João Távora, 2018/06/22
- [elpa] externals/eglot 0176264 12/12: * eglot.el (Version): Bump to 0.11, João Távora, 2018/06/22
- [elpa] externals/eglot 610d95b 03/12: Use gfm-mode for formatted strings (#20), João Távora, 2018/06/22
- [elpa] externals/eglot 0cde01f 05/12: Close #26: Guess server for js2-mode and rjsx-mode, João Távora, 2018/06/22
- [elpa] externals/eglot 364348d 04/12: Close #25: Improve eglot-ensure and mention it in README.md, João Távora, 2018/06/22
- [elpa] externals/eglot efc0f45 02/12: Minor cleanup to new textDocument/formatting feature, João Távora, 2018/06/22
- [elpa] externals/eglot a9010f1 01/12: Implement formatting (#19), João Távora, 2018/06/22
- [elpa] externals/eglot 17ef74e 07/12: Defer textDocument/formatting requests, João Távora, 2018/06/22
- [elpa] externals/eglot 0b9cffe 08/12: Per #22: Apply text edits atomically, João Távora, 2018/06/22
- [elpa] externals/eglot 48c3f45 10/12: Close #22: Apply text edits as a single undoable edit,
João Távora <=
- [elpa] externals/eglot cbc418c 06/12: Per #22: Simplify eglot-format-buffer, João Távora, 2018/06/22
- [elpa] externals/eglot df5e72e 09/12: Close #23: Report progress when applying edits, João Távora, 2018/06/22