Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix more bugs in eglot--apply-text-edits #64

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,9 @@ If SKIP-SIGNATURE, don't try to send textDocument/signatureHelp."
;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32237
;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32278
(let ((inhibit-modification-hooks t)
(length (- end beg)))
(length (- end beg))
(beg (marker-position beg))
(end (marker-position end)))
(run-hook-with-args 'before-change-functions
beg end)
(replace-buffer-contents temp)
Expand All @@ -1478,7 +1480,10 @@ If SKIP-SIGNATURE, don't try to send textDocument/signatureHelp."
(progress-reporter-update reporter (cl-incf done)))))))
(mapcar (jsonrpc-lambda (&key range newText)
(cons newText (eglot--range-region range 'markers)))
edits))
;; Reverse the edits so that if there are multiple
;; insertions in the same place, they appear in the buffer
;; in the original order, as per the standard.
(nreverse edits)))
(undo-amalgamate-change-group change-group)
(progress-reporter-done reporter))))

Expand Down